What is pragma exception and how, when, where us

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


Please Help Members By Posting Answers For Below Questions

What are the types of subqueries?

568


What is asqueryable?

523


What is the usage of nvl function?

594


What is database sql?

537


What is a sql driver?

521






What is primary key secondary key alternate key candidate key?

536


What is an intersect?

643


What is the meaning of disabling a trigger?

643


What is difference between stored procedures and application procedures?

565


What is the plv (pl/vision) package offers?

605


What is the use of sqlerrd 3?

515


Write a query to find the names of users that begin with "um" in sql?

493


What will you get by the cursor attribute sql%rowcount?

545


What are records give examples?

556


Explian rowid, rownum? What are the psoducolumns we have?

556