17,140
社区成员




create or replace test return number as
begin
update table set salary=salary*(1+0.05) where name like '王%' and salary<2000;
commit;
return 0;
exception
when others then
return 1;
end;
create or replace test1(val1 in number,val2 in number)
v_id number;
v_name varchar2(10);
v_salary number;
as
cursor v_cur is select id,name,salary from table where salary<=val2 and salary>=val1 order by salary;
begin
open v_cur;
fetch v_cur into v_id,v_name,v_salary;
while v_cur %found loop
dbms_output.put_line(v_id||chr(9)||v_name||chr(9)||v_salary);
fetch v_cur into v_id,v_name,v_salary;
end loop;
close v_cur;
end;
select rownum,name,
sum(case id when 1 then int_rate else 0 end) int_rate1,
sum(case id when 2 then int_rate else 0 end) int_rate2,
sum(case id when 3 then int_rate else 0 end) int_rate3
from a group by name;
create or replace test return number as
begin
update table set 薪水=薪水*(1+0.05) where 姓='王' and 薪水<2000;
return 0;
exception
when others then
return 1;
end;