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
Write an sql query to select all records from the table?
how many tables will create when we create table, what are they? : Sql dba
how to enter numeric values as hex numbers? : Sql dba
What is compiled query?
What is a constraint?
How many developers work on postgresql?
How can a function retun more than one value in oracle with proper example?
How we can create a table in pl/sql block. Insert records into it? Is it possible by some procedure or function? Please give example?
discuss about myisam key cache. : Sql dba
What are the types of variable use in pl sql?
What is rowtype?
Is sql open source?
what is union? : Sql dba
Enlist some predefined exceptions?
What is procedure in pl sql?