SQL>
SQL> create table org_level(
2 company_id number(8) not null,
3 org_level varchar2(1) not null
4 );
Table created.
SQL>
SQL> DECLARE
2 invalid_org_level EXCEPTION;
3 PRAGMA EXCEPTION_INIT(invalid_org_level,-2290);
4 BEGIN
5 INSERT INTO org_level VALUES (1001,'P');
6 COMMIT;
7 EXCEPTION WHEN invalid_org_level THEN
8 dbms_output.put_line('Organization Level');
9 END;
10 /
PL/SQL procedure successfully completed.
SQL>
SQL> drop table org_level;
Table dropped.
SQL>
|