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
Give the order of sql select?
What is foreign key in sql with example?
Why triggers are used?
What is case function?
what are integrity rules?
what is the difference between ereg_replace() and eregi_replace()? : Sql dba
What is form and report?
Is it possible to sort a column using a column alias?
Does sql view stored data?
Can we use ddl statements in stored procedure sql server?
How many types of indexes are there in sql?
Who is the owner of mysql database?
What are the steps for performance tuning.
What are the sql versions?
Is sql between inclusive?