I was learning RETURNING...INTO clause. Any idea on why i am getting this error while i try to execute the below block
create table logan as select * from emp where 1=2;
SQL> set serveroutput on
SQL> DECLARE
2 x emp.empno%TYPE;
3 BEGIN
4 INSERT INTO LOGAN (EMPNO,ENAME,sal)
5 SELECT empno,ename,sal from emp
6 RETURNING empno
7 INTO x;
8 dbms_output.put_line(x);
9 UPDATE logan
10 set sal= nvl(sal,0)+12
11 where empno=x;
12
13 commit;
14 end;
15 /
RETURNING empno
*
ERROR at line 6:
ORA-06550: line 6, column 13:
PL/SQL: ORA-00933: SQL command not properly ended
ORA-06550: line 4, column 3:
PL/SQL: SQL Statement ignored
Message was edited by:
J.Kiechle