开发者

Continue statement in Pl/sql

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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜