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

Answers were Sorted based on User's Feedback



I have a small PL/SQL Block assume in this way begin select * from emp where empno=100; except..

Answer / kavitha nedigunta

yes this will give error,
1.need to include the into clause.
(PLS-00428: an INTO clause is expected in this SELECT
statement)
2.as in exception block when others
should be at the bottom of the exception block.
(PLS-00370: OTHERS handler must be last among the exception
handlers of a block)

Is This Answer Correct ?    20 Yes 0 No

I have a small PL/SQL Block assume in this way begin select * from emp where empno=100; except..

Answer / virendra

yes this will give error, as in exception block when others
should be at the bottom of the exception block.

ex.

exception
when no_data_found then
<Some Messages>
when too_many_rows then
<Some Messages>
when others then
<Some Messages>
end;

Is This Answer Correct ?    19 Yes 3 No

I have a small PL/SQL Block assume in this way begin select * from emp where empno=100; except..

Answer / 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

More SQL PLSQL Interview Questions

how mysql optimizes distinct? : Sql dba

0 Answers  


I have a Employee table with columns ename,eid,salary,deptno. How to retrieve sum of salary for each deptno?

8 Answers   L&T,


What is db journal file?

0 Answers  


where are cookies actually stored on the hard disk? : Sql dba

0 Answers  


explain commit and rollback in mysql : sql dba

0 Answers  


What is a primary key sql?

0 Answers  


Can we use ddl commands in pl sql?

0 Answers  


What does select count (*) mean in sql?

0 Answers  


What is oracle sql called?

0 Answers  


<<labele>> declare a=10 b=20, begin some statements declare a=30 c=40 end; what is the A value in nested block?

1 Answers   ITC Infotech,


Can two tables have same primary key?

0 Answers  


What are instead of triggers?

0 Answers  


Categories