Previous Topic: SQL Error HandlingNext Topic: Online Displays


SQL Return Codes -117 and -118

If SQLCODE contains -117, the error was detected by CA Datacom/DB. Check other SQLCA fields for the internal and/or external CA Datacom/DB return code to determine what action you should take. See the CA Datacom/DB Message Reference Guide for descriptions of CA Datacom/DB return codes and messages.

If SQLCODE contains -118, the error was detected by the CA Datacom Datadictionary Service Facility. Check other SQL Communication Area (SQLCA) fields for a specific CA Datacom Datadictionary Service Facility return code to determine what caused the error. See the CA Datacom/DB Message Reference Guide for descriptions of CA Datacom Datadictionary Service Facility return codes and CA Datacom Datadictionary messages.

The following table lists the information placed in other SQLCA fields. Code your program so that it prints or displays all of the SQLCA's return code information.

SQLCA Field

SQLCODE=0
No Error

SQLCODE=-117
CA
DATACOM/DB

SQLCODE=-118
CA Datacom Datadictionary
Service
Facility

 

SQLCA-DSFCODE

bbbb

 

Naaa

Mnnn
Mccc
D000

SQLCA-DBCODE-INT

null

n

null

n

SQLCA-DBCODE-EXT

bb

nn

bb

nn

SQLCA-ERROR-PGM

b

DBSERV

b

ccc
DDL

SQLCA-ERR-MSG

b

error message

return data

return data

SQLSTATE

00000

Seeii

Rdddd

Reeii

b

A blank indicates the command was successful, or no data was returned to the field.

null

A null value (binary zeros).

n

The one-byte CA Datacom/DB internal return code. See the section on CA Datacom/DB Return Codes in the CA Datacom/DB Message Reference Guide for a description of the error and corrective action to take.

nn

The two-byte CA Datacom/DB external return code. See the section on CA Datacom/DB Return Codes in the CA Datacom/DB Message Reference Guide for a description of the error and corrective action to take.

DBSERV

Internal information.

Naaa

The N indicates this is a normal alphanumeric return code, while the aaa represents the actual alphanumeric return code from the CA Datacom Datadictionary Service Facility. See the section on CA Datacom Datadictionary Service Facility Return Codes in the CA Datacom/DB Message Reference Guide for a description of the error and corrective action to take.

Mnnn

M indicates return code is from a module of CA Datacom Datadictionary. The nnn represents the numeric return code from the CA Datacom Datadictionary Service Facility. Use the first three bytes of the SQLCA-ERROR-PGM field as the first three three of the return code. See the section on CA Datacom Datadictionary Service Facility Internal Return Codes in the CA Datacom/DB Message Reference Guide for a description of the error and corrective action to take.

Mccc

The M indicates the return code is from a module of CA Datacom Datadictionary, while the ccc represents the CA Datacom Datadictionary Service Facility return code from the interface module that populates CA Datacom Datadictionary. See the section on CA Datacom Datadictionary Service Facility Internal Return Codes in the CA Datacom/DB Message Reference Guide for a description of the error and corrective action to take.

D000

Indicates that a CA Datacom/DB return code was received during CA Datacom Datadictionary Service Facility processing. See the SQLCA-DBCODE for the CA Datacom/DB internal and external return codes.

ccc

Indicates the CA Datacom Datadictionary Service Facility module reporting the error. This three-character module name and the last three bytes of the SQLCA-DSFCODE field indicate the error. See the CA Datacom/DB Message Reference Guide for a description of the error and corrective action to take.

DDL

Indicates the error was reported by the interface module that populates CA Datacom Datadictionary.

return data

If applicable, up to 80 bytes of formatted information specific to the request causing the error is returned in the SQLCA-ERR-MSG field. Check the SQLCA-DSFCODE field for the return code and see the CA Datacom/DB Message Reference Guide for a description of the error and corrective action to take.

If the SQLCA-DSFCODE field contains D000, the information in the return data indicates the CA Datacom/DB request issued when the error was detected, including the command, the return code and the CA Datacom/DB table name.

Rdddd

The R in the first position associates the SQLSTATE with -118. The dddd is the DSF code returned to SQL.

Reeii

The R in the first position associates the SQLSTATE with -118. The ee represents the 2-byte external CA Datacom/DB return code. The ii represents the CA Datacom/DB internal return code in hexadecimal characters.

Seeii

The S in the first position associates the SQLSTATE with -117. The ee represents the 2-byte external CA Datacom/DB return code. The ii represents the CA Datacom/DB internal return code in hexadecimal characters.