create or replace procedure ZXM
as
CURSOR cure IS
select vcuserid,ncreditcount from users;begin
for c in cure loop
update tbbuylist set iscore=c.ncreditcount where vcbuid=c.vcuserid;
end loop;
exception
when no_data_found then
dbms_output.PUT_LINE('没有数据');
end;
as
CURSOR cure IS
select vcuserid,ncreditcount from users;begin
for c in cure loop
update tbbuylist set iscore=c.ncreditcount where vcbuid=c.vcuserid;
end loop;
exception
when no_data_found then
dbms_output.PUT_LINE('没有数据');
end;
另外用FOR循环其实就是用隐形游标了。你不用定义可以直接写
for f c in select vcuserid,ncreditcount from users loop
update tbbuylist set iscore=c.ncreditcount where vcbuid=c.vcuserid;
end loop;