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

Are sql database names case sensitive?

495


What does data normalization mean?

525


Can we use two order by clause in query?

543


what is offset-fetch filter in tsql? : Transact sql

530


What is a primary key sql?

559






What is linq to sql?

550


What is difference between sql function and stored procedure?

503


First round ------------------- - Procedure - Packages - Views - Virtual tables - Can we use dcl with in function? - Joins and few scenarios - Triggers and its type - Pragma, type and its functionality - How to create db link in oracle - Materialized view - How to find duplicate values from table? - Cursor and its functionality - Write a script to display friday and its date from a entire year. - Exception Handling Second round ------------------------ Gave a scenario like. Need to write a function to perform. When user try to change a password. It must not be last five password and a given password can be combination of characters, symbols, upper and lower case.

1136


Explain some predefined exceptions.

582


How many types of keys are there in sql?

550


what is bcp? When does it used? : Sql dba

519


Explain correlated query work?

589


What is natural join in sql?

535


What is sql prepared statement?

542


What is the main reason behind using an index?

550