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

882665Aug 31 2011 — edited Sep 2 2011
set 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 .
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 30 2011
Added on Aug 31 2011
12 comments
2,425 views