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!

PRAGMA EXCEPTION_INIT is not working for -1403

Rajan SwJul 24 2019 — edited Jul 24 2019

Hi Experts,

I have written a programme and just mention a user-defined error for error no -1403 but gettting compilation error.

However if I replace -1403 with 100 which is the error code for no_data_found  it is working fine but the Oracle documentation describes differently.

is it the known behaviour.

I am using Oracle 12c R2

DECLARE

  v_dname  VARCHAR2(100);

  e_invalid_dept  EXCEPTION;

 

  PRAGMA EXCEPTION_INIT(e_invalid_dept,-01403);

BEGIN

  SELECT deptno  INTO v_dname FROM EMP WHERE deptno=100;

 

 

EXCEPTION

  WHEN e_invalid_dept THEN

     DBMS_OUTPUT.PUT_LINE('There is a fatal  error and the error code is '||SQLCODE||' and the error message is '||SQLERRM);

 

END;

This post has been answered by Zlatko Sirotic on Jul 24 2019
Jump to Answer
Comments
Post Details
Added on Jul 24 2019
3 comments
688 views