【发布时间】:2016-01-07 01:21:25
【问题描述】:
想知道是不是这样的:
begin
for C2 in cursor_sal loop
if something then
update emp
set name = George
where ID = 1
elsif something2 then
update emp
set name = Steve
where ID = 4
end if
end loop;
end;
可以变成这样或类似的东西:
begin
for C2 in cursor_sal loop
update emp
if something then
set name = George
elsif something2 then
set name = Steve
end if
where current of C2
end loop;
end;
或者这是不可能的,我坚持第一个例子?
【问题讨论】:
-
你可以使用变量。
-
如何使用变量来在 Update 语句中使用 IF 语句?会不会和我在第一个例子中的完全一样?
标签: plsql sql-update cursor