Answer Posted / guru
The PRAGMA EXECPTION_INIT tells the complier to associate an
exception with an oracle error. To get an error message
of a specific oracle error.
e.g. PRAGMA EXCEPTION_INIT (exception name, oracle error
number)
Example
declare
salary number;
FOUND_NOTHING exception;
Pragma exception_init(FOUND_NOTHING ,100);
begin
select sal in to salaryfrom emp where ename ='ANURAG';
dbms_output.put_line(salary);
exception
WHEN FOUND_NOTHING THEN
dbms_output.put_line(SQLERRM);
end;
| Is This Answer Correct ? | 10 Yes | 3 No |
Post New Answer View All Answers
Can you have a foreign key without a primary key?
What are the main features of cursor?
How does postgresql compare to mysql?
Why are cursors used?
What is offset in sql query?
what is the command line end user interface - mysql? : Sql dba
How consistent is the view of the data between and within multiple sessions, transactions or statements ?
What does (*) mean in sql?
where are cookies actually stored on the hard disk? : Sql dba
What if we write return in procedure?
how can we know the number of days between two given dates using mysql? : Sql dba
What is an implicit commit?
What is a common use of group by in sql?
How do I remove all records from a table?
what is sql profiler? : Sql dba