Which two statements are true about the handling of internally defined or user-defined PL7SQL
exceptions? (Choose two.)
A.
Add exception handlers whenever errors occur.
B.
An exception handler should commit the transaction.
C.
Handle named exceptions whenever possible instead of using when others in exception
handlers.
D.
Instead of adding exception handlers to your PL/SQL block, check for errors at every point
where they may occur.
A D
A C
A C
http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/errors.htm#LNPLS00712
A. Add exception handlers wherever errors can occur.
Errors are especially likely during arithmetic calculations, string manipulation, and database operations. Errors can also arise from problems that are independent of your code—for example, disk storage or memory hardware failure—but your code still must take corrective action.
C. Whenever possible, write exception handlers for named exceptions instead of using OTHERS exception handlers.
Learn the names and causes of the predefined exceptions. If you know that your database operations might raise specific internally defined exceptions that do not have names, then give them names so that you can write exception handlers specifically for them.
c,d
CD agree
AC
http://docs.oracle.com/cd/B13789_01/appdev.101/b10807/07_errs.htm#i3880
Advantages of PL/SQL Exceptions,
Guidelines for Avoiding and Handling PL/SQL Errors and Exceptions
A is true:
If you need to check for errors at a specific spot, you can enclose a single statement or a group of statements inside its own BEGIN-END block with its own exception handler.
B is false:
Carefully consider whether each exception handler should commit the transaction, roll it back, or let it continue. Remember, no matter how severe the error is, you want to leave the database in a consistent state and avoid storing any bad data.
C is true:
Handle named exceptions whenever possible, instead of using WHEN OTHERS in exception handlers.
Isolating error-handling routines makes the rest of the program easier to read and understand.
D is false:
Instead of checking for an error at every point it might occur, just add an exception handler to your PL/SQL block
I agree with you. Correct answers are: A & C because of what is said in the link below:
http://docs.oracle.com/cd/B13789_01/appdev.101/b10807/07_errs.htm#i3880
A -> is CORRECT because : “Add exception handlers whenever there is any possibility of an error occurring”
C -> is CORRECT because : “Handle named exceptions whenever possible, instead of using WHEN OTHERS in exception handlers”
B -> is wrong because : Carefully consider whether each exception handler should commit the transaction, roll it back, or let it continue.
D -> is WRONG because : “Instead of checking for an error at every point it might occur, just add an exception handler to your PL/SQL block.” -> which is exactly the opposite of what they are saying in answer D
AC
A,C
B is false because:
For each exception handler, carefully decide whether to have it commit the transaction, roll it back, or let it continue.
Regardless of the severity of the error, you want to leave the database in a consistent state and avoid storing bad data.
Advantages of PL/SQL Exceptions-
Instead of checking for an error at every point it might occur, just add an exception handler to your PL/SQL block. If the exception is ever raised in that block (or any sub-block), you can be sure it will be handled.
So D is wrong.
A, C
A,C
A,C
One of our visitors recently suggested the following website.
that may be the end of this article. Here youll come across some web-sites that we believe youll enjoy, just click the hyperlinks over
AC
AC