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...


While inserting 10 rows using procedure, if 3rd entry is
having some error, what will be the output? How u will
handle that error?

Answers were Sorted based on User's Feedback



While inserting 10 rows using procedure, if 3rd entry is having some error, what will be the outpu..

Answer / radha sri seshu.kolla

WHEN YOU TRAP THE ERROR TILL THAT ROW THE ROWS WILL BE
INSERTED SUCCESSFULLY
IF YOU DONT HANDLE THE ERROR NO ROWS WILL BE INSERTED.
IF YOU ISSUE COMMIT AFTER EACH ROW THE FIRST TWO ROWS WILL
BE INSERTED SUCCESSSFULLY
IF YOU ISSUE COMMIT AT THE END NO ROWS WILL BE INSERTED

Is This Answer Correct ?    12 Yes 0 No

While inserting 10 rows using procedure, if 3rd entry is having some error, what will be the outpu..

Answer / vaibhavi_dixit

When an exception is raised, oracle searches for the
handler in the PL/SQL block, if not then the exception is
propagated to the outer block.If the outer block handles
the exception, then the statments are commited (i.e 1 & 2),
the error message will be displayed and the control will
return to calling environment.
If the exception remains unhandled in all blocks ,then
before control returning to the calling environment,
statements i.e (1 & 2) will be rolled back.

VD

Is This Answer Correct ?    13 Yes 2 No

While inserting 10 rows using procedure, if 3rd entry is having some error, what will be the outpu..

Answer / vetrikumaran

IT THROWS THE ERROR.NO ROWS WILL BE INSERTED.

Is This Answer Correct ?    5 Yes 1 No

While inserting 10 rows using procedure, if 3rd entry is having some error, what will be the outpu..

Answer / raji_4u

IF THE PROCEDURE HAS AN EXCEPTION HANDLER,THEN ALL THE
RECORDS ARE INSERTED EXCEPT THE 3rd RECORD.

IF THE PROCEDURE DOES NOT HAVE THE EXCEPTION HANDLER, THE
EXCEPTION PROPAGATES TO THE CALLING BLOCK'S EXCEPTION SECTION.
IF THE EXCEPTION IS HANDLED, ONLY THE FIRST TWO RECORDS ARE
INSERTED ie(1st, 2nd).

IF THE CALLING BLOCK ALSO DOES NOT HANDLE THE EXCEPTION, NO
RECORDS ARE INSERTED SINCE THE TRANSACTION IS ROLLED BACK.

IF YOU WANT TO HANDLE THE ERROR, PLACE A EXCEPTION HANDLER
IN THE PROCEDURE AND LOG THE ERROR. THIS MAKES ONLY THE 3rd
RECORD TO ROLLBACK AND ALL OTHER RECORDS ARE INSERTED.

Is This Answer Correct ?    7 Yes 3 No

While inserting 10 rows using procedure, if 3rd entry is having some error, what will be the outpu..

Answer / rj

Hello. if any one of them insert statement is wrong then no
data is inserted.
if you used commit statemnt then it also not work means no
data will be saved in table
Thanks
K.....

please write this example and run
i have only change data type in second insert statemnet


create or replace procedure test_emp
begin
insert into emp(EMPNO, ENAME)
values(1,'R');
insert into emp(EMPNO, ENAME)
values(TEST,'01');
insert into emp(EMPNO, ENAME)
values(2,'S');
commit;
end;

Is This Answer Correct ?    6 Yes 2 No

While inserting 10 rows using procedure, if 3rd entry is having some error, what will be the outpu..

Answer / rahul khanke

first two inserted row will be rollback and nothing will be
inserted

i think is according to oracle architectur or commit and
rollback , redo and undo FUNDAS

Is This Answer Correct ?    2 Yes 0 No

While inserting 10 rows using procedure, if 3rd entry is having some error, what will be the outpu..

Answer / meenadevi.m

NO ROWS WILL BE INSERTED.

IT THROWS 0 ROW(S) AFFECTED

Is This Answer Correct ?    0 Yes 2 No

While inserting 10 rows using procedure, if 3rd entry is having some error, what will be the outpu..

Answer / rajeshwaran

First two rows will be inserted and the third entry will
cause Run time error and the execution will be terminated
by inserting first two rows into the table.

Is This Answer Correct ?    4 Yes 10 No

Post New Answer

More SQL PLSQL Interview Questions

what is meant by urlencode and urldocode? : Sql dba

0 Answers  


What are joins in sql?

0 Answers  


What is native sql query?

0 Answers  


Can we use join in subquery?

0 Answers  


Which join is like inner join?

0 Answers  


How do you determine the current isolation level? : Transact sql

0 Answers  


how to delete duplicate rows from a specified table(only single table) how do you know which join is need to be used

11 Answers   UST,


Does mysql_real_escape_string prevent sql injection?

0 Answers  


What is a table partition?

0 Answers  


How do I start pl sql?

0 Answers  


Differences between Oracle 9i and 10g (Probably in terms of SQL and PL/SQL)?

0 Answers   IBM,


how to create user in sql and how to set password for that?

3 Answers  


Categories