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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is db journal file?

673


What is data control language (dcl)?

784


How do I truncate a sql log file?

731


What is a crud api?

677


What are the types of join and explain each?

769






What is a recursive join sql?

804


What are different types of sql?

751


What are the main features of cursor?

819


What is recursive stored procedure?

806


Can sql developer connect to db2?

752


What is difference sql and mysql?

697


What is a temporal table?

664


What is tuple in sql?

727


What is a ddl command?

714


How do I kill a query in postgresql?

747