Sqlcode Db2

Only available on StudyMode
  • Download(s) : 52
  • Published : March 8, 2013
Open Document
Text Preview
Contents of SQLCA:

01 SQLCA.
05 SQLCAID PIC X(8).
05 SQLCABC PIC S9(9) COMP.
05 SQLCODE PIC S9(9) COMP.
05 SQLERRM.
49 SQLERRML PIC S9(4) COMP.
49 SQLERRMC PIC X(70).
05 SQLERRP PIC X(8).
05 SQLERRD OCCURS 6 TIMES PIC S9(9) COMP. 05 SQLWARN.
10 SQLWARN0 PIC X(1).
10 SQLWARN1 PIC X(1).
10 SQLWARN2 PIC X(1).
10 SQLWARN3 PIC X(1).
10 SQLWARN4 PIC X(1).
10 SQLWARN5 PIC X(1).
10 SQLWARN6 PIC X(1).
10 SQLWARN7 PIC X(1).
05 SQLEXT.
10 SQLWARN8 PIC X(1).
10 SQLWARN9 PIC X(1).
10 SQLWARNA PIC X(1).
10 SQLSTATE PIC X(5).

The SQLCA is described in the following table, including the field names used in each language, the data type, and a discussion of the purpose of each field.

COBOL
Name| C
Name| PL/I
Name| Data
Type| Purpose |
SQLCAID| sqlcaid| SQLCAID| char(8)| A character string (SQLCA) that identifies the beginning of the SQLCA.| SQLCABC| sqlcabc| SQLCABC| integer| Specifies the length of the SQLCA. Value is always 136.| SQLCODE| sqlcode| SQLCODE| integer| Contains a return code pertaining to the most recent SQL statement executed. Important values are: 0 Statement executed successfully (may have had warnings).

>0 Executed successfully but with an exception condition. <0 An error occurred.
100 End of data reached. |
SQLERRML| sqlerrml| SQLERRML| smallint| The length of the SQLERRMC string (0 to 70). If 0, the value of SQLERRMC is not pertinent.| SQLERRMC| sqlerrmc| SQLERRMC| varchar (70)| One or more tokens, separated by x'ff', that are substituted into error messages to provide specific information about an error condition.| SQLERRP| sqlerrp| SQLERRP| char(8)| Indicates the product signature in the format pppvvrrm where: ppp = XDB

vv = XDB version number
rr = XDB release number
m = Operating system:
N = NT
O = OS/2
D = DOS |
SQLERRD(1)| sqlerrd[0]| SQLERRD(1)| integer| Reserved for internal use.| SQLERRD(2)| sqlerrd[1]| SQLERRD(2)| integer| Reserved for internal use.| SQLERRD(3)| sqlerrd[2]| SQLERRD(3)| integer| Number of rows affected by an INSERT, UPDATE or DELETE command.| SQLERRD(4)| sqlerrd[3]| SQLERRD(4)| integer| Not used by XDB.| SQLERRD(5)| sqlerrd[4]| SQLERRD(5)| integer| Contains the position or column of a syntax error for a PREPARE or EXECUTE IMMEDIATE statement.| SQLERRD(6)| sqlerrd[5]| SQLERRD(6)| integer| Not used by XDB.| SQLWARN0| sqlwarn0| SQLWARN0| char(1)| Flag used to signal warning condition. If blank, then all other SQLWARN variables are blank. If value is W, then at least one other SQLWARN has a W.| SQLWARN1| sqlwarn1| SQLWARN1| char(1)| If value is W, then at least one column's value was truncated when stored in a host variable.| SQLWARN2| sqlwarn2| SQLWARN2| char(1)| If value is W, then at least one null value was eliminated from the argument of a column function. May not be set to W for a MIN function because its results are not dependent on the elimination of null values. | SQLWARN3| sqlwarn3| SQLWARN3| char(1)| If value is W, then the number of columns is larger than the number of host variables.| SQLWARN4| sqlwarn4| SQLWARN4| char(1)| If value is W, then a prepared UPDATE or DELETE statement does not contain a WHERE clause.| SQLWARN5| sqlwarn5| SQLWARN5| char(1)| If value is W, your program tried to create an index that contains a field that exceeds the maximum length for an index. This use is XDB-specific.| SQLWARN6| sqlwarn6| SQLWARN6| char(1)| Not used by XDB.| SQLWARN7| sqlwarn7| SQLWARN7| char(1)| Not used by XDB....
tracking img