Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> dbms_output in PROC

dbms_output in PROC

From: Laurent Kloetzer <charles.magne.non.au.spam_at_kloetzer.fr.st>
Date: Wed, 26 Apr 2006 15:58:10 +0200
Message-ID: <mn.d3be7d642bbb278d.36141@kloetzer.fr.st>


Hello everybody,
i'm quite a newbie in Pro*C.
I have a Pro*C program that calls a stored procedure. I would like to trace to debug my stored procedure (already tested in SQLPLUS) in that pro*c context.

I tried something like the code below but the last call to get_line fails and returns me the following error:

"ORA-01405:fetched column value is NULL"

I tried things with get_lines, etc. but did not succeed.

Any help (with a demo code working) would be REALLY appreciated.

Thank you,

LK


 	EXEC SQL EXECUTE
        BEGIN
        	DBMS_OUTPUT.ENABLE(2000);  --  buffer size defaults to 2000
    	END;

    END-EXEC;
 	EXEC SQL EXECUTE
        BEGIN
        	/* here : code that calls dbms_output.put_line*/
        	DBMS_OUTPUT.PUT_LINE('Test 1');
        	DBMS_OUTPUT.PUT_LINE('Test 2');
        	DBMS_OUTPUT.PUT_LINE('Test 3');
    	END;

    END-EXEC;
 	EXEC SQL BEGIN declare section;
         VARCHAR        line[256];
         int             status;
 	EXEC SQL END declare section;

 	for(;;)
     {
         EXEC SQL EXECUTE
         BEGIN
                 DBMS_OUTPUT.GET_LINE( :line, :status );
         END;
         END-EXEC;
         if ( status ) break;
         printf( "%d %.*s\n", status, line.len, line.arr );
     }
------------------------
Received on Wed Apr 26 2006 - 08:58:10 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US