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


Please Help Members By Posting Answers For Below Questions

What does truncate mean in sql?

534


What does inner join mean?

552


How many types of functions are there in sql?

501


Where do we use pl sql?

549


What is left join in sql?

580






What is the difference between left join and right join?

500


How to change the order of columns in Oracle SQL Plus ?

610


What does := mean in pl sql?

553


What is sql resultset?

527


How do I create a sql database?

518


Why do we need unique key in a table?

523


Is sql considered coding?

567


How is sql used in oracle?

577


What is sql deadlock?

562


How many types of primary keys are there?

525