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


Please Help Members By Posting Answers For Below Questions

When is the update_statistics command used?

769


what are enums used for in mysql? : Sql dba

816


What is sql partition function?

801


How to select the Nth maximum salary from Table Emp in Oracle SQL Plus ?

814


What is %type in pl sql?

712






What is the difference between the implicit and explicit cursors?

744


Is left join inner or outer by default?

762


What are the types of queries in sql?

745


What are synonyms in sql?

730


What is a data definition language?

791


What is your daily office routine?

1987


What are the query optimization techniques?

711


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.

1838


What are two statement types in sql?

746


What is an implicit commit?

762