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

Can we create a trigger on view?

0 Answers  


use of IN/ANY/ALL

5 Answers   Ramco,


what is Complex index. how to create it?

2 Answers  


What is meant by temporal data?

0 Answers  


How can get second highest salary in sql?

0 Answers  


What is flag in sql?

0 Answers  


If we have n no of columns in a table, can we add new column in that table with not null constraint?

2 Answers  


What is sql partition function?

0 Answers  


Can we use two order by clause in query?

0 Answers  


How can you load microsoft excel data into oracle? : aql loader

0 Answers  


What are all ddl commands?

0 Answers  


Which is faster view or stored procedure?

0 Answers  


Categories