Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PLSQL script not printing CLOB data ( what am I doing wrong? )

637159Oct 5 2011 — edited Oct 5 2011
Here 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
This post has been answered by Solomon Yakobson on Oct 5 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 2 2011
Added on Oct 5 2011
2 comments
397 views