Oracle® Database PL/SQL Language Reference 11g Release 2 (11.2)
http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/errors.htm#LNPLS007
Uni Potsdam - Wiki (Stefan Uhlmann)
http://fara.cs.uni-potsdam.de/~uhlmann/19/ch09.html
Freitag, 29. August 2014
Freitag, 22. August 2014
For Cursor Loop - Example
set serveroutput on;
--
DECLARE
v_anzahlDS NUMBER(20);
BEGIN
FOR n IN (SELECT owner, table_name
FROM all_tables
WHERE owner = 'SCOTT' order by 1)
LOOP
execute immediate 'select count(*) from '|| n.owner ||'.'|| n.table_name INTO v_anzahlDS;
dbms_output.put_line(n.table_name || ' ' || v_anzahlDS);
END LOOP;
END;
--
DECLARE
v_anzahlDS NUMBER(20);
BEGIN
FOR n IN (SELECT owner, table_name
FROM all_tables
WHERE owner = 'SCOTT' order by 1)
LOOP
execute immediate 'select count(*) from '|| n.owner ||'.'|| n.table_name INTO v_anzahlDS;
dbms_output.put_line(n.table_name || ' ' || v_anzahlDS);
END LOOP;
END;
Abonnieren
Posts (Atom)