-- Created on 2018/5/28
declare
-- Local variables here
V_SQL VARCHAR2(1000);
--i integer;
rec_kc22 kc22%rowtype;
TYPE ref_cursor_type IS REF CURSOR; --定义一个动态游标
usrs ref_cursor_type;
begin
-- Test statements here
v_sql := 'select * from kc22 where id = 355896010';
open usrs for v_sql;
loop
fetch usrs
into rec_kc22;
exit when usrs%notfound;
dbms_output.put_line(rec_kc22.id);
end loop;
close usrs;
end;
简单动态游标写法
最新推荐文章于 2021-07-05 19:01:15 发布