PLSQL script not printing CLOB data ( what am I doing wrong? )
637159Oct 5 2011 — edited Oct 5 2011Here is the script:
SQL> DECLARE
2 v_command_script CLOB;
3 CURSOR commandscripts IS
4 select
5 taskdata from rn_schedule_task where taskdata like '%scripts type="script%';
6 BEGIN
7 open commandscripts;
8 LOOP
9 fetch commandscripts INTO v_command_script;
10 exit when commandscripts%ROWCOUNT > 20 or commandscripts%NOTFOUND;
11 DBMS_OUTPUT.PUT_LINE('commadscript = ' || v_command_script);
12 end LOOP;
13 CLOSE commandscripts;
14 end;
15 /
PL/SQL procedure successfully completed.
SQL>
I haven't used DBMS_OUTPUT.PUT_LINE for CLOB data before, but I would think it would work. Do I need to convert to CHAR first?
BTW: the select statement does return rows.. there are over 200K that meet that criteria