What is pragma exception and how, when, where us

Answers were Sorted based on User's Feedback



What is pragma exception and how, when, where us..

Answer / shaik

Pragma Exception is a pre-compiled exception which is
particularly used to raise the user defined exceptions along
with the ORACLE error code.

PRAGMA EXCEPTION_INIT(exception_name, -Oracle_error_number);

ANY FURTHER CLARIFICATION CALL TO ME :09972372227

Is This Answer Correct ?    12 Yes 2 No

What is pragma exception and how, when, where us..

Answer / 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

What is pragma exception and how, when, where us..

Answer / guest

Its bad to see that Questions are not asked properly, and next is, people are not answering correctly, but no one is questioning them back.

Eg:- What is pragma exception and how, when, where us ...

Shaik --
Its not a Pre compiled exception, it is a Compiler Directive which has special meaning to this keyword.

Amit Kumar--
The Error range is from -20000 to -20999

Ramesh--
Your question is not clear.
eg:-How it compiler find?....

Guys Please be serious, as this is a good place to learn and share knowledge. Anyone who is really looking for interview questions will get wrong answers in their preparation

regards
j

Is This Answer Correct ?    7 Yes 0 No

What is pragma exception and how, when, where us..

Answer / amit kumar dwivedi

pragma is compiler directive and pragma exception_init is
used to associate user deifined name to error number(within
range of 20000-20999).

Is This Answer Correct ?    6 Yes 6 No

What is pragma exception and how, when, where us..

Answer / ramesh

How it compiler find. your answer will not fit my problem.

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More SQL PLSQL Interview Questions

What is trigger and stored procedure in sql?

0 Answers  


what is d diff between grant,commit,rollback n savepoint

1 Answers  


What is an ndf file?

0 Answers  


check whether all the emp numbers are indeed unique.

6 Answers  


what are different types of collation sensitivity? : Sql dba

0 Answers  






If a View on a single base table is manipulated will the changes be reflected on the base table?

5 Answers  


What is the difference between alter trigger and drop trigger statements?

0 Answers  


write an sql query to find names of employee start with 'a'? : Sql dba

0 Answers  


Table 1: col1 Timestamp ---------------- 01-mar-2012 11:12:46 Table 2: col2 Timestamp -------------------- 01-mar-2012 11:12:10 01-mar-2012 11:11:23 Write a query to display a row with table2 col2 value less than tabl1 col1 value. Maximum timestamp value previous to table1 col1 value. Display a result as: Col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10

0 Answers  


How to select 10 records from a table?

0 Answers  


explain about mysql and its features. : Sql dba

0 Answers  


Is natural join same as inner join?

0 Answers  


Categories