Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2004
    Posts
    4

    Unanswered: SqlPlus error stack vs SQLERRM in PL/SQL

    I have a situation where a package body may go invalid resulting in a :

    ORA-06508: PL/SQL: could not find program unit being called


    If I capture this exception in PL/SQL using SQLCODE and SQLERRM the above error is all I see.

    If I don’t handle the exception I see the following returned to SQL*Plus:

    ERROR at line 1:
    ORA-04068: existing state of packages has been discarded
    ORA-04063: package body "APPS.FOO" has errors
    ORA-06508: PL/SQL: could not find program unit being called
    ORA-06512: at "APPS.FEE", line 5
    ORA-06512: at line 2

    Note the additional diagnostics.

    Is there a way to capture the entire "error stack" within PL/SQL ?

    Example code:

    Pkg spec

    CREATE OR REPLACE PACKAGE Foo AS
    PROCEDURE bar;
    END Foo;

    Procedure

    CREATE OR REPLACE PROCEDURE Fee
    IS
    BEGIN
    DBMS_OUTPUT.PUT_LINE('In procedure Fee');
    Foo.bar;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('Error Code is '||TO_CHAR(SQLCODE));
    DBMS_OUTPUT.PUT_LINE(SQLERRM);
    END Fee;

    Invocation

    BEGIN
    Fee;
    end;

    Thanks
    Ken

  2. #2
    Join Date
    Oct 2004
    Posts
    4
    Found it.......

    dbms_utility.format_error_stack
    and
    dbms_utility.format_error_stack

    KenF

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •