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
What is sql query optimization?
What are the advantages of pl sql over sql?
How sql query is executed?
What is a unique constraint?
What is percent sign in sql?
Explain the the update statement in sql?
is it possible to pass an object or table to a procedure as an argument?
what are tables and fields? : Sql dba
What does stand for in sql?
what is single byte over head in oracle..?
Is oracel sql developer written in java?
What is a null value?
How to add, remove, modify users using sql?
Does db2 use sql?
How many aggregate functions are available there in sql?