Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2002
    Location
    Germany
    Posts
    2

    Unanswered: retrieving line of last error

    Hello !

    Is it possible to get the line-number where the last error ocurred ?

    At example:

    CREATE OR REPLACE PROCEDURE do_stupid
    IS

    tempNum Number;

    BEGIN

    FOR i IN 1..5
    LOOP
    temp := sysdate;
    END LOOP;

    tempNum := 2;

    tempNum := tempNum / 0;

    tempNum := 3;

    EXCEPTION
    WHEN OTHERS THEN


    -- i want to access the line-number of the error "tempnum / 0"

    END do_stupid;

    Thank You !

    Florian

  2. #2
    Join Date
    Jul 2001
    Location
    Germany
    Posts
    189
    Hello,

    you can access the errors of a compilation by using the following
    SQL statement:

    SELECT OWNER, NAME, TYPE, SEQUENCE, LINE, POSITION, TEXT
    FROM SYS.ALL_ERRORS WHERE owner = 'SYS' AND name = 'NONAME';

    or use the AlligatorSQL ;-)

    Hope this helps ?

    Manfred Peter
    (Alligator Company)
    http://www.alligatorsql.com

  3. #3
    Join Date
    Feb 2002
    Location
    Germany
    Posts
    2
    I want to catch runtime Errors. A "Division by zero" doesnt throw a compilation error. The "Division by zero" should only be an example for everything which could throw an error - there could also be a "index not found" or anything else.

Posting Permissions

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