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 are all different types of collation sensitivity?

0 Answers  


wht is the difference between truncat,drop in sqlserver wht is the difference between function and stored procedure

3 Answers   Apollo,


What is the use of sqlerrd 3?

0 Answers  


How do I tune a sql query?

0 Answers  


What is clustered index in sql?

0 Answers  






What is a crud api?

0 Answers  


What is keys and its types?

0 Answers  


What are views in sql?

0 Answers  


what is a database lock ? : Sql dba

0 Answers  


What is the purpose of the primary key?

0 Answers  


What is normalization ?

9 Answers   BirlaSoft, CTS, HCL,


Does pl/sql support create command?

0 Answers  


Categories