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

What is the command used to fetch first 5 characters of the string?

876


What happens when a trigger is associated to a view?

494


What is a full join sql?

582


How to execute a stored procedure?

552


What is meant by cursor in sql?

532






How is a process of pl/sql compiled?

589


Are there any features that are decommissioned in 11g that are not present in 11g?

1580


What is type and rowtype in pl sql?

527


What is difference between ms sql and mysql?

470


how do you login to mysql using unix shell? : Sql dba

557


Is vs as in pl sql?

485


what is the difference between join and union? : Sql dba

539


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

528


can sql servers linked to other servers like oracle? : Sql dba

538


what is a unique key ? : Sql dba

535