-- anonymous_block_cursor.sql
--
-- Anonymous PL/SQL block - Example of processing a cursor
--
DECLARE
CURSOR c1 is
select a.table_name,b.parmname,
b.parmvalue,a.initial_extent,
a.next_extent
from dba_tables a, psrecddlparm b
where (a.table_name= b.recname or a.table_name=' PS_'||b.recname)
and platformid=2
and b.parmvalue <> initial_extent
and b.parmvalue <> next_extent
order by a.table_name, b.parmvalue;
v_table_name dba_tables.table_name%type;
v_parmname psrecddlparm.parmname%type;
v_parmvalue psrecddlparm.parmvalue%type;
v_initial_extent dba_tables.initial_extent%type;
v_next_extent dba_tables.next_extent%type;
BEGIN
OPEN c1;
FOR i IN 1..5 LOOP
FETCH c1 INTO v_table_name,v_parmname,v_parmvalue,v_initial_extent,v_next_extent;
EXIT WHEN c1%NOTFOUND;
dbms_output.put_line(v_table_name||' '||v_parmname||' '||v_parmvalue||' '||
v_initial_extent||' '||v_next_extent);
END LOOP;
CLOSE c1;
END;
|