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!

dbms_output.put_line not printing anything...

amardeep.sidhuMay 12 2008 — edited Jun 14 2012

Hi guys

I have an front end based application. One of the form (fmb) calls a report (rdf) and the report sets a role (for the user) and calls a backend PL/SQL package.

This package gives an error so i ran that procedure (from package) from SQL Plus by passing all the required parameters. The error given by the package is:

*
ERROR at line 1:
ORA-20001:  Exact Fetch Returns More Than Requested Number Of Rows
ORA-06512: at "OWNER.PACKAGE", line 1490
ORA-06512: at line 1

The only exception handling section in the procedure being called reads like:

EXCEPTION
    WHEN OTHERS THEN
       ROLLBACK;
    
     DECLARE
        L_MSG VARCHAR2(2000);
        L_LEN NUMBER;
      BEGIN
        L_MSG := SQLERRM (SQLCODE);
        L_LEN := TO_NUMBER(LENGTH(L_MSG));
        DBMS_OUTPUT.PUT_LINE(L_MSG);
        RAISE_APPLICATION_ERROR(-20001,
                                INITCAP(SUBSTR(L_MSG, 11, L_LEN - 10)));
      END;

Now when I am running it from SQL Plus (from appropriate user and after setting the ROLE) it gives the above error.

I removed the exception section and simply put WHEN_OTHERS handler (which will print SQLERRM). Now it doesn't print anything (serveroutput is ON). It simply says Procedure successfully executed. There are so many dbms messages in the package also. None of them is getting printed too :(

Any ideas why dbms_output.put_line is not able to print anything ?

Version: 10.2.0.3 on AIX 5.3 64 bit

Thanks

Amardeep Sidhu

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 12 2012
Added on May 12 2008
27 comments
54,760 views