I have a small PL/SQL Block
assume in this way
begin
select * from emp where empno=100;
exception
when others then
<Some Messages>
when no_data_found then
<Some Messages>
when too_many_rows then
<Some Messages>
end;
The question which he asked was whether this block will get
executed normally or it will throw error ?
If errored out then what is the reason for the error ?
Could anybody please help me ?
Regards
Nakul Venkataraman
Answer Posted / sdp
Yes , it will give an error as for single row queries we
need to include the into clause also
the query would be
declare
v_emp emp%rowtype%;
begin
select * into v_emp from emp where empno=100;
exception
---
---
end;
| Is This Answer Correct ? | 5 Yes | 8 No |
Post New Answer View All Answers
how to select first 5 records from a table? : Sql dba
Which is faster subquery or join?
how to calculate the difference between two dates? : Sql dba
What is an intersect?
how to use 'mysql' to run sql statements? : Sql dba
what is bcp? When does it used? : Sql dba
What is the difference between cross join and natural join?
What are some predefined exceptions in pl/sql?
Is it possible to pass parameters to triggers?
How to use sql statements in pl/sql?
What is the purpose of normalization?
What is the difference between function, procedure and package in pl/sql?
What is a variable in sql?
What are the disadvantages of file system?
how mysql optimizes distinct? : Sql dba