SET ECHO ON SET SERVEROUTPUT ON SET ARRAYSIZE 1 -- -- plsql07.txt -- -- Simple PL/SQL demo -- Create a table for demonstration purposes DROP TABLE dropmePlsql07; CREATE TABLE dropmePlsql07 as SELECT table_name,comments FROM dictionary WHERE table_name like '%CLUSTERS%'; DECLARE CURSOR dictCursor IS SELECT table_name,comments FROM dropmePlsql07; myTableName dropmePlsql07.table_name%TYPE; -- Main point of this demo, use of %TYPE myRec dropmePlsql07%ROWTYPE; -- Here is some more useful syntax BEGIN FOR aRecord IN dictCursor LOOP -- aRecord is an implicitly declared %ROWTYPE here IF aRecord.table_name = 'ALL_CLUSTERS' THEN myTableName := aRecord.table_name; -- Notice how I make use of the TYPE variable here myRec := aRecord; -- Notice how I make use of the ROWTYPE variable here END IF; END LOOP; DBMS_OUTPUT.PUT_LINE ( 'myTableName is ... '|| myTableName); DBMS_OUTPUT.PUT_LINE ( 'myRec.table_name is ... '|| myRec.table_name); DBMS_OUTPUT.PUT_LINE ( 'myRec.comments is ... '|| myRec.comments); END; / -- End of demo