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

Can we alter stored procedure?

636


what is self join and what is the requirement of self join? : Sql dba

767


What is trigger and types?

670


what is the difference between undefined value and null value? : Sql dba

658


what is a database? : Sql dba

703






How do I make my sql query run faster?

567


How to run sql functions in pl/sql?

622


Is sql difficult?

830


Mention what does plv msg allows you to do?

765


how to get help information from the server? : Sql dba

597


list out some tools through which we can draw e-r diagrams for mysql. : Sql dba

605


how to use like conditions? : Sql dba

673


how to include character strings in sql statements? : Sql dba

626


What is union, minus and interact commands?

849


What is composite primary key in sql?

607