Skip to end of metadata
Go to start of metadata


Overview

 Internally Defined Exceptions, namely System-defined Exception Codes, is classified as below.

System-defined Exception Codes

ORACLE

ALTIBASE HDB

Error Code(ORACLE, Integer)

Error Code(ALTIBASE HDB, Integer)

Comments

CURSOR_ALREADY_OPEN

CURSOR_ALREADY_OPEN

06511

201062

A program attempts to open an already open cursor.

DUP_VAL_ON_INDEX

DUP_VAL_ON_INDEX

00001

201063

A program attempts to store duplicate values in a
column that is constrained by a unique index.

INVALID_CURSOR

INVALID_CURSOR

01001

201064

A program attempts a cursor operation that is not
allowed, such as closing an unopened cursor.

INVALID_NUMBER

 

 

-01722

In a SQL statement, the conversion of a character string
into a number fails because the string does not
represent a valid number.

 

INVALID_PATH

 

201237

Invalid directory path(exception is not handled in the stored procedure or function)

 

INVALID_MODE

 

201235

Invalid file open mode(exception is not handled in the stored procedure or function)

 

INVALID_HANDLE

 

201238

Invalid file handle(exception is not handled in the stored procedure or function)

 

INVALID_OPERATION

 

201239

Invalid file operation(exception is not handled in the stored procedure or function)

NO_DATA_FOUND

NO_DATA_FOUND

01403

201066

A SELECT INTO statement returns no rows,
or your program references a deleted element in a nested table(not supported in altibase)
or an uninitialized element in an index-by table(associative array).

TOO_MANY_ROWS

TOO_MANY_ROWS

01422

201070

A SELECT INTO statement returns more than one row.

ACCESS_INTO_NULL

 

06530

 

A program attempts to assign values to the attributes of an uninitialized object

CASE_NOT_FOUND

 

06592

 

None of the choices in the WHEN clauses of a CASE
statement is selected, and there is no ELSE clause.

COLLECTION_IS_NULL

 

06531

 

A program attempts to apply collection methods other
than EXISTS to an uninitialized nested table or varray,
or the program attempts to assign values to the
elements of an uninitialized nested table or varray(not in altibase).

LOGIN_DENIED

 

01017

 

A program attempts to log on to ORACLE with an invalid
username or password.

NOT_LOGGED_ON

 

01012

 

A program issues a database call without being
connected to ORACLE.

PROGRAM_ERROR

 

06501

 

PL/SQL has an internal problem.

ROWTYPE_MISMATCH

 

06504

 

The host cursor variable and PL/SQL cursor variable
involved in an assignment have incompatible return
types.

SELF_IS_NULL

 

30625

 

A program attempts to call a MEMBER method, but the
instance of the object type has not been initialized.

STORAGE_ERROR

 

06500

 

PL/SQL runs out of memory or memory has been
corrupted.

SUBSCRIPT_BEYOND_COUNT

 

06533

 

A program references a nested table or varray element
using an index number larger than the number of
elements in the collection.

SUBSCRIPT_OUTSIDE_LIMIT

 

06532

 

A program references a nested table or varray element
using an index number (-1 for example) that is outside
the legal range.

SYS_INVALID_ROWID

 

01410

 

The conversion of a character string into a universal
rowid fails because the character string does not
represent a valid rowid.

TIMEOUT_ON_RESOURCE

 

00051

 

A time out occurs while Oracle is waiting for a
resource.

VALUE_ERROR

 

06502

 

An arithmetic, conversion, truncation, or
size-constraint error occurs.
For example, when your program selects a column value into a character
variable, if the value is longer than the declared length
of the variable, PL/SQL aborts the assignment and
raises VALUE_ERROR.

ZERO_DIVIDE

 

01476

 

A program attempts to divide a number by zero.

 

READ_ERROR

 

201242

File read error(exception is not handled in the stored procedure or function)

 

WRITE_ERROR

 

201243

File write error(exception is not handled in the stored procedure or function)

 

ACCESS_DENIED

 

201236

Directory access denied(exception is not handled in the stored procedure or function)

 

DELETE_FAILED

 

201240

File remove operation failed(exception is not handled in the stored procedure or function)

 

RENAME_FAILED

 

201241

File rename operation failed(exception is not handled in the stored procedure or function)



Example

As example shown below, A procedures for defining System-defined exception in the ALTIBASE HDB and ORACLE are same.

ORACLE

ALTIBASE HDB

Comments

CREATE OR REPLACE PROCEDURE PROC1
AS
BEGIN
 RAISE TOO_MANY_ROWS;
EXCEPTION
 WHEN TOO_MANY_ROWS THEN
 
 DBMS_OUTPUT.PUT_LINE('SQLCODE: ' || SQLCODE);
 DBMS_OUTPUT.PUT_LINE('SQLERRM: ' || SQLERRM);
 
END;
/

CREATE OR REPLACE PROCEDURE PROC1
AS
BEGIN
 RAISE TOO_MANY_ROWS;
EXCEPTION
 WHEN TOO_MANY_ROWS THEN
 
 PRINTLN('SQLCODE: ' || SQLCODE);
 PRINTLN('SQLERRM: ' || SQLERRM);
 
END;
/

 

CREATE OR REPLACE PROCEDURE PROC1
AS
BEGIN
 RAISE DUP_VAL_ON_INDEX;
EXCEPTION
 WHEN DUP_VAL_ON_INDEX THEN
 
 DBMS_OUTPUT.PUT_LINE('SQLCODE: ' || SQLCODE);
 DBMS_OUTPUT.PUT_LINE('SQLERRM: ' || SQLERRM);
 
END;
/

CREATE OR REPLACE PROCEDURE PROC1
AS
BEGIN
 RAISE DUP_VAL_ON_INDEX;
EXCEPTION
 WHEN DUP_VAL_ON_INDEX THEN
 
 PRINTLN('SQLCODE: ' || SQLCODE);
 PRINTLN('SQLERRM: ' || SQLERRM);
 
END;
/

 

  • No labels