declare
my_cur sys_refcursor; --定义游标变量,循环执行抓取锁的sql语句
type v_record is record( --定义 record类型
obj_id number,
obj_name varchar2(2000));
my_record v_record; --定义record变量
begin
open my_cur for ‘select object_id,object_name from dba_objects where object_id <20‘;
loop
fetch my_cur
into my_record;
exit when my_cur%notfound;
dbms_output.put_line(my_record.obj_id || chr(9) || my_record.obj_name);
end loop;
end;
时间: 2024-10-21 01:59:49