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
what is primary key? : Sql dba
Can we use distinct and group by together?
When is a declare statement required?
What are the main features of cursor?
Which is better stored procedure or query?
What is a full join sql?
Why is theta join required?
how can we know the count/number of elements of an array? : Sql dba
What is the use of sql trace?
Can we commit inside a trigger?
Differentiate pl/sql and sql?
what are the advantages and disadvantages of views in a database? : Sql dba
What does the acronym acid stand for in database management?
How do you remove duplicate records from a table?
What is a loop in sql?