Print long messages to DBMS_OUTPUT

The Oracle supplied package DBMS_OUTPUT has a number of limitations, one of these is a 255 character line limit. Of course Tom Kyte has a solution.


   -- print long messages to DBMS_OUTPUT
   --  see
   PROCEDURE p( p_string IN VARCHAR2 ) IS
      l_string   LONG DEFAULT p_string;
         EXIT WHEN l_string IS NULL;
         DBMS_OUTPUT.put_line( SUBSTR( l_string, 1, 250 ) );
         l_string := SUBSTR( l_string, 251 );
      END LOOP;

   p( 'Start of message' );
   p( str_vlong_string );
   p( 'End of message');




Need help? Let me take of your IT issues.

Share this page

Share on facebook
Share on linkedin
Share on twitter
Share on print
Share on email
Close Menu