永发信息网

一段简单的Oracle游标的代码

答案:1  悬赏:10  手机版
解决时间 2021-08-14 22:11
  • 提问者网友:雨不眠的下
  • 2021-08-14 04:53

DECLARE

new_employees hr.EMPLOYEES%ROWTYPE;

CURSOR cur_employees IS

SELECt * FROM hr.EMPLOYEES

FOR UPDATe OF DEPARTMENT_ID;

BEGIN

OPEN cur_employees;

LOOP

FETCH cur_employees INTO new_employees;

EXIT WHEN cur_toy%NOTFOUND;

DELETE FROM hr.EMPLOYEES WHERe DEPARTMENT_ID=30

WHERe CURRENT OF cur_employees;

END LOOP;

COMMIT;

END;

请路过的大侠帮我看下错在哪里了?

最佳答案
  • 五星知识达人网友:走死在岁月里
  • 2021-08-14 05:08

EXIT WHEN cur_toy%NOTFOUND;


改成


EXIT WHEN cur_employees %NOTFOUND;

我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯