Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: INSERT INTO...RETURNING doesn't work ( ORA-00933)
On Sun, 10 Apr 2005 23:49:32 GMT, Lewis C <lewisc_at_excite.com> wrote:
>On 10 Apr 2005 15:37:30 -0700, agonenil_at_gmail.com wrote:
>
>>hi , i get the following problem :
>>
>>SQL> Variable tot_sal number;
>>SQL> begin
>> 3 INSERT INTO emp select * from emp
>> 5 RETURNING sum(sal) INTO :tot_sal;
>> 7 dbms_output.put_line('Total Company Payroll now : ' ||
>>to_char(:tot_sal,'$9
>>99,999.00'));
>> 9 end;
>> 11 /
>>RETURNING sum(sal) INTO :tot_sal;
>> *
>>ERROR at line 5:
>>ORA-06550: line 5, column 11:
>>PL/SQL: ORA-00933: SQL command not properly ended
>>ORA-06550: line 3, column 1:
>>PL/SQL: SQL Statement ignored
>>
>>altough accrding to http://www.remote-dba.cc/10g_65.htm , it should
>>work.
>>
A link to a question on asktom that I think pertains to this discussion. The entire thread is worth reading but search on "returning thing I inserted", no quotes, for a direct answer.
Interesting issue.
Lewis
Author, ItToolBox Blog: An Expert's Guide to Oracle http://blogs.ittoolbox.com/oracle/guide/
Topic Editor, Suite101.com: Oracle Database http://www.suite101.com/welcome.cfm/oracle
Sign up for courses here:
http://www.suite101.com/suiteu/default.cfm/416752