簡體   English   中英

pl/sql中的continue語句

[英]Continue statement in Pl/sql

我正在工作 Oracle 10g。 我正在運行這個 pl/sql 塊

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= salary+3000 where current of Get_Data;
  end if;
end loop;
end;

它給了我這個錯誤: identifier 'CONTINUE' must be declared

請建議我如何解決這個問題。

請注意: CONTINUE僅在 Oracle 11g 中受支持。

請參閱此處:Oracle® 數據庫 PL/SQL 語言參考 11g 第 1 版 (11.1) > PL/SQL 有哪些新功能? > 繼續聲明

嘗試

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;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM