Error Handling
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Error Handling

  1. #1
    Join Date
    Mar 2004
    Posts
    4

    Error Handling

    I am using pro c as a part of development.

    I would like to know how to capture specific errors?

    right now I am routing all error and warning to a fucntion.

    For example

    how to handle this error?

    SQL-02112: SELECT..INTO returns too many rows


    can anyone show me an example of doing this?

  2. #2
    Join Date
    Jan 2003
    Location
    Hull, UK
    Posts
    220
    http://starlet.deltatel.ru/ora$doc/7/DOC/api/doc/PAD18/ch11.htm

    look for SELECT_ERROR clause in the above chapter.

    might be of some help to u.

  3. #3
    Join Date
    Jul 2002
    Location
    Slovenia
    Posts
    42
    there is simpe example of function that catch exceptions
    exception must be between begin and end ...

    CREATE OR REPLACE FUNCTION my_func RETURN NUMBER IS
    v_empno emp.empno%TYPE;
    BEGIN

    BEGIN
    SELECT empno INTO
    v_empno
    FROM emp;
    -- where 1=2
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    v_empno := -1;
    WHEN DUP_VAL_ON_INDEX THEN
    v_empno := -2;
    WHEN OTHERS THEN
    v_empno := -3;
    END;

    RETURN v_empno;
    END my_func;
    /
    Andrej

Posting Permissions

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


Click Here to Expand Forum to Full Width