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
Are sql database names case sensitive?
What does data normalization mean?
Can we use two order by clause in query?
what is offset-fetch filter in tsql? : Transact sql
What is a primary key sql?
What is linq to sql?
What is difference between sql function and stored procedure?
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.
Explain some predefined exceptions.
How many types of keys are there in sql?
what is bcp? When does it used? : Sql dba
Explain correlated query work?
What is natural join in sql?
What is sql prepared statement?
What is the main reason behind using an index?