-------------------------------------------
同时查询一张表查询并更新
-------------------------------------------
create or replace function getTimes
return integer is
F1 testa.F1 %TYPE;
F2 testa.F2 %TYPE;
F3 testa.F3 %TYPE;
F4 testa.F4 %TYPE;
/* 查询出testa表中的所有记录*/
cursor fcursor is select F1,F2,F3,F4 from testa ;
/* 更新testa表中的reconstr=F1+F2+F3+F4 */
begin
open fcursor;
loop
fetch fcursor into F1,F2,F3,F4;
update testa set reconstr= F1||F2||F3||F4 ;
commit;
exit when fcursor%notfound;
end loop;
close fcursor;
return 0;
end getTimes;
-------------------------------------------
同时查询两张表并更新
-------------------------------------------
create or replace function getTimes
return integer is
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余2页未读,立即下载