Which type of exceptions is qualified as no predefined Oracle server errors?

Which type of exceptions is qualified as no predefined Oracle server errors?

Which type of exceptions is qualified as no predefined Oracle server errors?

A.
the exceptions that are explicitly raised by the program and can be caught by the exception
handler

B.
the exceptions that are raised implicitly by the Oracle server and can be caught by the
exception handler

C.
an exception that the developer determines as abnormal, are in the declarative section and
raised explicitly

D.
an exception that is raised automatically when the PL/SQL program violates a database rule or
exceeds a system-dependent limit

Explanation:



Leave a Reply 13

Your email address will not be published. Required fields are marked *


Leonid

Leonid

There are 3 types of exceptions:
1) Predefined Oracle Server error
Description: One of approximately 20 errors that occur most often in PL/SQL code
How to handle: Do not declare and allow the Oracle server to raise them implicitly

2) Nonpredefined Oracle Server error
Description: Any other standard Oracle Server error
How to handle: Declare within the declarative section and allow the Oracle Server to raise them implicitly

3) User-defined error
Description: A condition that the developer determines is abnormal
How to handle: Declare within the declarative section, and raise explicitly

source: http://www-is.offis.uni-oldenburg.de/sqlkurs/plsql/pdf/HandlingExceptions.PDF

So, I’m not sure about the right answer….

Jyoti

Jyoti

no predefined Oracle server errors means which is not listed already in Oracle’s list

SO it signifies to User defined esceptions. ANS IS “c”

samkelo siyabonga ngubo

samkelo siyabonga ngubo

C

Piero

Piero

B
I THINK
IT WOULD BE BETTERE EXPOSED IF THE QUESTION EXPLAIN THAT THI KIND OF EXCEPTION ARE NOT DECLARED IN THE STANDARD PACKAGE SO THE DEVELOPER MUST DECLARE IT IN THE DECLARATION SESSION, AND WITH PRAGMA INIT ASSIGN THE RIGHT VALUE OF THE ERROR TO LET THE HANDLE…

gelete

gelete

B.

Pre-defined exceptions
A pre-defined exception is a descriptive name assigned to an internally defined exception (ORA-xxxxx).
For example: “ORA-01422” is an internally defined exception. “TOO_MANY_ROWS” is the
pre-defined exception assigned to ORA-01422.
Because they have names, it is possible to create exception handlers for them.

A partial list of predefined exceptions is:
TOO_MANY_ROWS ORA-01422
CASE_NOT_FOUND ORA-06592
CURSOR_ALREADY_OPEN ORA-06511
INVALID_CURSOR ORA-01001
INVALID_NUMBER ORA-01722
NO_DATA_FOUND ORA-00100
PROGRAM_ERROR ORA-06501
ROWTYPE_MISMATCH ORA-06504
SUBSCRIPT_BEYOND_COUNT ORA-06533
SUBSCRIPT_OUTSIDE_LIMIT ORA-06532
VALUE_ERROR ORA-06502

Non-predefined exceptions
They are not defined as PL/SQL exceptions in the Oracle server.
They are standard Oracle errors (ORA-xxxxx errors)
Only a tiny fraction of the internally defined exceptions (ORA-xxxxx) are also Pre-defined exceptions.

You can create exceptions with standard Oracle errors by using the PRAGMA EXCEPTION_INIT function. Such exceptions are called nonpredefined exceptions.

You can trap a nonpredefined Oracle server error by declaring it first. The declared exception is raised implicitly.

DECLARE
e_MissingNull EXCEPTION;
PRAGMA EXCEPTION_INIT(e_MissingNull, -1400);
BEGIN
INSERT INTO employees (id) VALUES (NULL);
EXCEPTION
WHEN e_MissingNull then
DBMS_OUTPUT.put_line(‘ORA-1400 occurred’);
END;

giosefer

giosefer

The correct answer is B!

juzz4fun

juzz4fun

Ans: D
Non-predefined errors are ORA-xxx errors that are not defined but will be raised automatically if any DB rules is broken by PLSQL (e.g. ORA-00904 – invalid column name). If you try to delete a column from a table and if that column doesn’t exists at all then ORA-00904 will be raised and program will be terminated abruptly. You can handle such exceptions by defining this exception using the ORA number and using PRAGMA EXCEPTION_INIT() clause in DECLARE section (e.g. PRAGMA EXCEPTION_INIT (e_invalid_clm, -904);) and use this name in EXCEPTION section (when e_invalid_clm). But in its pure form (undefined), it will be raised implicitly and program will be terminated. So answer D makes more sense than B.