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
When is the update_statistics command used?
what are enums used for in mysql? : Sql dba
What is sql partition function?
How to select the Nth maximum salary from Table Emp in Oracle SQL Plus ?
What is %type in pl sql?
What is the difference between the implicit and explicit cursors?
Is left join inner or outer by default?
What are the types of queries in sql?
What are synonyms in sql?
What is a data definition language?
What is your daily office routine?
What are the query optimization techniques?
in oracle 10g sw after compiling procedure how to pass parameter values ,if we (v_empid out number)how to give empid after successful compilation program.This site exact suitable for 10g with respect to question & answer same format , im trying sql browser & sql command prompt using exec procedure name & respective parameters.
What are two statement types in sql?
What is an implicit commit?