Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

how to select first 5 records from a table? : Sql dba

919


Which is faster subquery or join?

1144


how to calculate the difference between two dates? : Sql dba

993


What is an intersect?

1045


how to use 'mysql' to run sql statements? : Sql dba

983


what is bcp? When does it used? : Sql dba

933


What is the difference between cross join and natural join?

960


What are some predefined exceptions in pl/sql?

1063


Is it possible to pass parameters to triggers?

1030


How to use sql statements in pl/sql?

1053


What is the purpose of normalization?

995


What is the difference between function, procedure and package in pl/sql?

1135


What is a variable in sql?

950


What are the disadvantages of file system?

1163


how mysql optimizes distinct? : Sql dba

1000