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 the usage of when clause in trigger?

571


Is it possible to pass parameters to triggers?

576


Differentiate between % rowtype and type record.

735


What are the types of records?

539


Why do we need databases?

569






Where can I learn sql for free?

509


What is pl/sql table? Why is it used?

565


What is %type in pl sql?

542


How to use distinct and count in sql query? Explain

614


What is the use of index in hive?

550


How to move files from one directory to another in pl sql?

642


how to create a new table in mysql? : Sql dba

554


what is 'mysqlcheck'? : Sql dba

577


What is procedure explain with program?

554


What is procedure and function?

520