9 Error Codes Support in Oracle Database Provider for DRDA

Oracle Database Provider for DRDA has error code support, and supports management of errors and warnings generated by applications developed for DB2 and DRDA.

Oracle Error Codes

In DRDA and DB2, certain types of operations may be successful but generate a warning. For example, when an operation generates an integer overflow situation, DB2 continues and returns the rest of the row data with an indicator set for the column value that contains the error. It will also issue the warning code +802:

(EXCEPTION ERROR exceptioncode HAS OCCURRED DURING
   operationtype OPERATION 
   ON datatype DATA, 
   POSITION positionnumber)

In DB2 and DRDA, negative SQLCODEs are errors, and positive SQLCODEs are warnings. Oracle, unlike DRDA (and DB2), has no notion of a warning condition. In Oracle, call execution is either successful or generates an error. For example, Oracle treats an overflow situation as an error, and does not continue. Thus, Oracle Database Provider for DRDA cannot emulate DB2 behavior precisely.

However, most normal error conditions that are common to both Oracle and DRDA (and DB2) may be mapped.

“Error Code Mappings, from Oracle to DRDA” lists some common Oracle error codes and their equivalent SQL codes and SQL states.

Error Code Mapping, from Oracle to DRDA

Table 9-1 Error Code Mappings, from Oracle to DRDA

Oracle Error Code SQLCODE SQLSTATE Error Code Description

ORA-00001

-803

23505

Unique constraint violation

ORA-00900

-104 or -199

42601

Invalid SQL statement

ORA-00900

-84

42616

Invalid SQL statement

ORA-00901

-104 or -199

42601

Invalid CREATE command

ORA-00902

-104 or -199

42601

Invalid datatype

ORA-00903

-104 or -199

42601

Invalid table name

ORA-00904

-204

42704

Invalid identifier

ORA-00904

-206

42703

Invalid identifier

ORA-00905

-199

42601

Misspelled keyword

ORA-00906

-104

42601

Missing left parenthesis

ORA-00907

-104

42601

Missing right parenthesis

ORA-00908

-104

42601

Missing NULL

ORA-00909

-170

42605

Incorrect number of arguments

ORA-00910

-604

42611

Creating a CHAR column with length of max+1

ORA-00911

-104 or -199

42601

Invalid character

ORA-00913

-117

42802

Too many values

ORA-00917

-104 or -199

42601

Missing coma

ORA-00918

-203

42702

Ambiguous column usage

ORA-00920

-104 or -199

42601

Invalid relational operator

ORA-00922

-104 or -199

42601

Invalid or missing option

ORA-00923

-104

42601

FROM keyword not found where expected

ORA-00925

-104

42601

Missing INTO keyword

ORA-00926

-104

42601

Missing VALUES keyword

ORA-00927

-199

42601

Missing = sign

ORA-00928

-104

42601

Missing SELECT keyword

ORA-00932

-408

42821

Value not compatible with target column type

ORA-00933

-104 or -199

42601

SQL command not properly ended

ORA-00934

-120

42903

Group function not allowed

ORA-00936

-104 or -199

42601

Missing expression

ORA-00937

-122

42803

Not a single group function

ORA-00942

-204

42704

Table or view does not exist

ORA-00947

-117

42802

Not enough values

ORA-00950

-104 or -199

42601

Invalid DROP option

ORA-00955

-601

42710

Name is already used by an existing object

ORA-00957

-612

42711

Duplicate column name

ORA-00960

-203

42702

Ambiguous column naming in select list

ORA-00969

-104

42601

Missing ON keyword

ORA-00971

-104

42601

Missing SET keyword

ORA-00972

-107

46002

Identifier is too long

ORA-00975

-182

42816

Date + date not allowed

ORA-00979

-122

42803

Not a GROUP BY expression

ORA-00999

-104 or -199

42601

Invalid view name

ORA-01000

-905

57014

Maximum open cursors exceeded

ORA-01002

-501

22003

Fetch out of sequence

ORA-01008

-313

07001

Not all variables bound

ORA-01031

-551

42501

Insufficient privilege to perform operation on object

ORA-01036

-313

07001

Illegal variable name/number

ORA-01400

-407

23502

Cannot insert NULL into column

ORA-01403

+100

02000

No data found

ORA-01410

-399

22511

Invalid ROWID

ORA-01422

-811

21000

Exact fetch returns more than requested number of rows

ORA-01424

-130

22019

Missing or illegal character following the escape character

ORA-01425

-130

22025

Escape character must be string of length 1

ORA-01427

-811

21000

Single-row subquery returns more than one row

ORA-01435

-553

42503

User does not exist

ORA-01438

-413

22003

Value larger than specified precision allowed for this column

ORA-01455

-413

22003

Converting column overflows INTEGER datatype

ORA-01476

-802

22012

Divisor equal to zero

ORA-01488

-302

22001

Invalid nibble or byte in the input data

ORA-01722

-408

42821

Invalid number

ORA-01730

-158

42811

CREATE VIEW with ambiguous number of columns

ORA-01745

-313

07001

Invalid host/bind variable name

ORA-01747

-104 or -199

42601

Invalid table or column specification

ORA-01756

-104

42603

Missing quote for quoted string

ORA-01789

-421

42826

Operands of a set operator do not have the same number of columns

ORA-01830

-181

22007

Date format picture ends before converting entire input string

ORA-01841

-181

22007

(Full) year must be between -4713 and +9999, and not 0

ORA-01843

-181

22007

Bad month

ORA-01847

-181

22007

Bad year

ORA-01858

-181

22007

not numeric where numeric expected in date

ORA-01861

-180

22007

Literal does not match format string

ORA-02089

-426

2D528

COMMIT is not allowed in subordinate session

ORA-02291 -530 23503 Parent not found (insert/update/delete)
ORA-02292 -531 23504 Child not found (insert/update)
ORA-02292 -532 23504 Child not found (delete)

ORA-04043

-204

42704

Object not found

ORA-04063

-84

42612

Package body has errors

ORA-06550

-204

42504

Reports various PL/SQL errors, such as:

  • PLS00201: identifier must be declared

  • PLS-00904: insufficient privilege to access object

ORA-06576

-440

42884

Not a valid function or procedure name

ORA-08006

-508

24504

Specified row no longer exists

ORA-12899

-404

22001

Value too large for column

ORA-20980

-551

42501

User does not have package privilege for operation

ORA-20981

-917

42969

Bind package failed

ORA-20982

-551

42501

User does not have package privilege for operation

ORA-20983

-722

42704

Package does not exist

ORA-22275

-423

0F001

Invalid LOB locator specified

ORA-24333

-104 or -199

42601

Misspelled SQL statement

ORA-24381

-253

22529

array insert or merge reported some errors

All other errors

-84

42612