How do you handle exceptions. Give the syntax for it?



How do you handle exceptions. Give the syntax for it?..

Answer / guest

declare
khali exception;
a number(8);
b number(8);
begin
select count(*) into b from &table_name;
dbms_output.put_line('value of b is '||b);
if b = 0 then
raise khali;
end if;
exception
when khali then
dbms_output.put_line('are ye table to khali
nikali');
when others then
select NUM into a from furzi2;
dbms_output.put_line('Others');
end;
/

Is This Answer Correct ?    10 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

what is the purpose of update command in oracle?

7 Answers   MBT,


what are the differences between require and include, include_once and require_once? : Sql dba

0 Answers  


What does where 1 1 mean in sql?

0 Answers  


What found sql?

0 Answers  


what is commit? : Sql dba

0 Answers  


Is delete faster than truncate?

0 Answers  


Give me some examples of predefined exceptions.

3 Answers  


What is dbo in sql?

0 Answers  


what is the difference between cursor FETCH and FOR LOOP ?

3 Answers   CG-VAK, Tech Mahindra,


What is the difference between partitioning and sharding?

0 Answers  


What is the starting oracle error number? What is meant by forward declaration in functions?

0 Answers  


What are the parts of a sql statement?

0 Answers  


Categories