第2题的:
declare
cursor c_dept is select * from dept for update;
v_loc dept.loc%type;
v_dept c_dept%rowtype;
begin
for v_dept in c_dept loop
case v_dept.loc
when 'NEW YORK' then v_loc:='BEIJING';
when 'DALLAS' then v_loc:='SHANGHAI';
when 'CHICAGO' then v_loc:='GUANGZHOU';
when 'BOSTON' then v_loc:='XIAMEN';
end case;
update dept set loc=v_loc where current of c_dept;
end loop;
commit;
end;
/
你好无聊。
还要写优缺点。