While inserting 10 rows using procedure, if 3rd entry is
having some error, what will be the output? How u will
handle that error?
Answer Posted / 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 |
Post New Answer View All Answers
How much ram can sql express use?
What does varchar include?
describe transaction-safe table types in mysql : sql dba
What are views in sql?
Is clustered index a primary key?
How can you maintain the integrity of your database on instances where deleting an element in a table result in the deletion of the element(s) within another table?
How do you determine the current isolation level? : Transact sql
How to write pl sql program in mysql command prompt?
what's the difference between a primary key and a unique key? : Sql dba
what is a database lock ? : Sql dba
What is the use of sql trace?
What is an exception in pl/sql?
what is self-join? : Sql dba
how to enter numeric values as hex numbers? : Sql dba
Does sql*plus also have a pl/sql engine?