请问 kingofworl(良辰美景虚度)
create or replace procedure is
v_sql varchar2(100);
begin
v_sql:'select * from tab';
execute immediate v_sql;
end
中可以将fetch结果放到 ref cursor中吗?
declare
-- Local variables here
i integer;
SqlString varchar2(500);
Ctest sys_refcursor;
TableName tab.tname%type;
begin
-- Test statements here
SqlString:='select tname from tab';
open Ctest for sqlstring;
fetch Ctest into TableName;
while Ctest%found loop
dbms_output.put_line(TableName);
fetch Ctest into TableName;
end loop;
Close Ctest;
end;
----------------
A Simple Test