pragma exception_init
882665Aug 31 2011 — edited Sep 2 2011set serveroutput on;
declare
e_exception2 exception;
pragma exception_init(e_exception2,-1403);
v_data varchar2(20);
begin
select first_name into v_data from employees where employee_id = 4324;
exception
when e_exception2
then dbms_output.put_line('error by pragma exception_init');
end;
Error starting at line 2 in command:
declare
e_exception2 exception;
pragma exception_init(e_exception2,-1403);
v_data varchar2(20);
begin
select first_name into v_data from employees where employee_id = 4324;
exception
when e_exception2
then dbms_output.put_line('error by pragma exception_init');
end;
Error report:
ORA-06550: line 2, column 3:
PLS-00701: illegal ORACLE error number -1403 for PRAGMA EXCEPTION_INIT
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
in the above code i have assigned the error number of no_data_found to e_exception2
when i compile it shows the above error .