1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| declare
type type_ref_cursor is ref cursor;
cur type_ref_cursor;
lc$col1 "type de col1";
lc$col2 "type de col2";
lc$existe integer;
declare
type type_ref_cursor is ref cursor;
cur type_ref_cursor;
lc$col1 "type de col1";
lc$col2 "type de col2";
lc$existe integer;
begin
select count(*)
into lc$existe
from user_tables
where table_name = 'TABLE1';
if (lc$existe = 1) then
open cur for 'select * from table1';
loop
fetch cur
into lc$col1, lc$col2;
dbms_output.put_line(lc$col1 || ' ' || lc$col2);
exit when cur%notfound;
end loop;
end if;
end; |