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

Name the different types of indexes in sql and define them.

0 Answers  


What packages(if any) has oracle provided for use by developers?

1 Answers  


What are the new features in Oracle 10g. Compared to Oracle 9i?

1 Answers   Polaris,


what is the output of this query selet * from employee where 1=2 ??

11 Answers  


what is sql profiler

2 Answers   Fidelity,






What is the Diff b/w Constraints and Trigeer

4 Answers   HCL,


How to access the current value and next value from a sequence?

6 Answers  


what are null values? : Sql dba

0 Answers  


How is pl sql different from sql?

0 Answers  


How many aggregate functions are available there in sql?

0 Answers  


there is A table and B table in A table there 5 rows and in b table there are 2 rows i am firing query select * from a,b what will be the output?

7 Answers   Cognizant,


What does where 1/2 mean in sql?

0 Answers  


Categories