Home » SQL & PL/SQL » SQL & PL/SQL » error in procedure code
error in procedure code [message #312644] Wed, 09 April 2008 09:14 Go to next message
RRRR
Messages: 6
Registered: April 2008
Junior Member

please what is the error in this procedure cod

Quote:
create or replace procedure delproc is
cursor del_cur is
select * from employees where salary >= 450;
for update;
cur_row del_cur%rowtype;
begin
open del_cur;
loop
fetch del_cur into cur_row
exit when (del_cur%notfound);
delete from employees where current of del_cur;
end loop;
close del_cur;
end delproc;
/


when i execute it :

Procedure created with compilation errors.

and when i make show errors:

PLS-00103: Encountered the symbol "FOR" when expecting one of the
following:
begin function package pragma procedure subtype type use
<an identifier> <a double-quoted delimited-identifier> form
current cursor

thank you Smile
Re: error in procedure code [message #312645 is a reply to message #312644] Wed, 09 April 2008 09:18 Go to previous messageGo to next message
BlackSwan
Messages: 25045
Registered: January 2009
Location: SoCal
Senior Member
>select * from employees where salary >= 450;
>for update;
select * from employees where salary >= 450 for update;
Re: error in procedure code [message #312647 is a reply to message #312644] Wed, 09 April 2008 09:23 Go to previous message
RRRR
Messages: 6
Registered: April 2008
Junior Member
Thank you Smile
and i forgot a semicolon after fetch statement

thanks
Previous Topic: ora-00900
Next Topic: IS THERE ANY EQUIVALENT FUNCTION IN ORACLE LIKE GROUP_CONCAT IN MYSQL (merged 3)
Goto Forum:
  


Current Time: Wed Dec 07 16:15:23 CST 2016

Total time taken to generate the page: 0.10977 seconds