-
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?
-
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.
-
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;
/