I am working Oracle 10g. I am running this pl/sql block
Declare
cursor Get_Data is select * from employee for update;
data Get_Data%rowtype;
Begin
for data in Get_Data loop
if(data.salary=5000) then
continue;
else
update employee set salary= 开发者_JAVA百科salary+3000 where current of Get_Data;
end if;
end loop;
end;
It is giving me this Error : identifier 'CONTINUE' must be declared
please suggest me how to resolve this problem.
Just a note: CONTINUE
is supported only in Oracle 11g.
Refer here: Oracle® Database PL/SQL Language Reference 11g Release 1 (11.1) > What's New in PL/SQL? > CONTINUE Statement
Try
Declare
cursor Get_Data is select * from employee for update;
data Get_Data%rowtype;
Begin
for data in Get_Data loop
if(data.salary<>5000)
update employee set salary= salary+3000 where current of Get_Data;
end if;
end loop;
end;
精彩评论