PL/SQL Error Handling Interview Question and Answers
21. |
What happen when there is no handler for a raised exception? |
|
- If an exception is raised and there is no handler in the current block, the exception would propagate to the enclosing block.
- If no handler is found in the enclosing block, the exception will be propagated to the calling environment as an unhandled exception.
|
22. |
Give a few pre-defined Oracle errors? |
|
Pre-defined Oracle errors are as follows:
- NO_DATA_FOUND – Refers to an error when a SELECT statement does not return any result set
-
DUP_VAL_ON_INDEX – Refers to an error when a Program tries to store duplicate values in an indexed column
-
TOO_MANY_ROWS – Refers to an error when a SELECT INTO statement returns more than one row.
-
VALUE_ERROR – Refers to an error when an arithmetic, conversion, truncation, or size- constraints error occurs
-
ROWTYPE_MISMATCH – Refers to an error when the actual and formal parameters do not have the same data types
|
23. |
Where will the control be transferred if an exception is raised within an exception section of the block? |
|
When an exception is raised within an exception section of a block, the control is transferred to the exception section of the enclosing block. |
24. |
Is it possible to have more than one OTHERS clause? |
|
No, it is not possible to have more than one OTHERS clause in the exception section. |