SET ECHO ON SET SERVEROUTPUT ON -- -- plsql03.txt -- -- Simple PL/SQL demo DECLARE CURSOR dictCursor IS SELECT table_name,comments FROM dictionary WHERE table_name like '%TABLES' ORDER BY table_name; myTableName VARCHAR2(30); myComments VARCHAR2(4000); BEGIN -- Here I demonstrate some CURSOR syntax which is simpler than the -- 'OPEN ... FETCH ... EXIT WHEN ... CLOSE' METHOD. -- Some DBAs refer to this as a 'Cursor-For-loop'. FOR aRecord IN dictCursor LOOP myTableName := aRecord.table_name; myComments := aRecord.comments; DBMS_OUTPUT.PUT_LINE ( 'myTableName is ... ' || myTableName ); END LOOP; END; / -- End of demo