Sunday, August 8, 2010

SQLCA

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.


SQLCA :- Description


COBOL NameC NamePL/I NameData TypePurpose
SQLCAIDsqlcaidSQLCAIDchar(8)A character string (SQLCA) that identifies the beginning of the SQLCA.
SQLCABCsqlcabcSQLCABCintegerSpecifies the length of the SQLCA. Value is always 136.
SQLCODEsqlcodeSQLCODEintegerContains 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.
SQLERRMLsqlerrmlSQLERRMLsmallintThe length of the SQLERRMC string (0 to 70). If 0, the value of SQLERRMC is not pertinent.
SQLERRMCsqlerrmcSQLERRMCvarchar (70)One or more tokens, separated by x'ff', that are substituted into error messages to provide specific information about an error condition.
SQLERRPsqlerrpSQLERRPchar(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)integerReserved for internal use.
SQLERRD(2)sqlerrd[1]SQLERRD(2)integerReserved for internal use.
SQLERRD(3)sqlerrd[2]SQLERRD(3)integerNumber of rows affected by an INSERT, UPDATE or DELETE command.
SQLERRD(4)sqlerrd[3]SQLERRD(4)integerNot used by XDB.
SQLERRD(5)sqlerrd[4]SQLERRD(5)integerContains the position or column of a syntax error for a PREPARE or EXECUTE IMMEDIATE statement.
SQLERRD(6)sqlerrd[5]SQLERRD(6)integerNot used by XDB.
SQLWARN0sqlwarn0SQLWARN0char(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.
SQLWARN1sqlwarn1SQLWARN1char(1)If value is W, then at least one column's value was truncated when stored in a host variable.
SQLWARN2sqlwarn2SQLWARN2char(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 result are not dependent on the elimination of null values.
SQLWARN3sqlwarn3SQLWARN3char(1)If value is W,then the number of columns is larger than the number of host variables.
SQLWARN4sqlwarn4SQLWARN4char(1)If value is W,then a prepared UPDATE or DELETE statement does not contain a WHERE clause.
SQLWARN5sqlwarn5SQLWARN5char(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.
SQLWARN6sqlwarn6SQLWARN6char(1)Not used by XDB.
SQLWARN7sqlwarn7SQLWARN7char(1)Not used by XDB.
SQLWARN8sqlwarn8SQLWARN8char(1)Not used by XDB.
SQLWARN9sqlwarn9SQLWARN9char(1)Not used by XDB.
SQLWARNAsqlwarnaSQLWARNAchar(1)Not used by XDB.
SQLSTATEsqlstateSQLSTATEchar(5)Contains SQLSTATE value for this error.


SQL CODES
Successful Execution SQLCODE
000 SUCCESSFUL EXECUTION

Warning SQLCODES
+100 ROW NOT FOUND FOR FETCH, UPDATE OR DELETE, OR THE RESULT OF A QUERY IS AN EMPTY TABLE
+162 TABLE SPACE database-name, tablespace-name HAS BEEN PLACED IN CHECK PENDING
+304 A VALUE WITH DATA TYPE data-type1 CANNOT BE ASSIGNED TO A HOST VARIABLE BECAUSE THE VALUE IS NOT WITHIN THE RANGE OF THE HOST VARIABLE IN POSITION position-number WITH DATA TYPE data-type2
+402 LOCATION location IS UNKNOWN
+403 THE LOCAL OBJECT REFERENCED BY THE CREATE ALIAS STATEMENT DOES NOT EXIST
+558 THE WITH GRANT OPTION IS IGNORED BECAUSE GRANT IS TO PUBLIC
+560 THE WITH GRANT OPTION IS IGNORED FOR UPDATE (COLUMN-LIST)
+561 THE ALTER AND INDEX PRIVILEGES CANNOT BE GRANTED TO “PUBLIC AT ALL LOCATIONS”
+625 THE DEFINITION OF TABLE table-name HAS BEEN CHANGED TO INCOMPLETE
+802 EXCEPTION ERROR exception-type HAS OCCURRED DURING operation-type OPERATION ON data-type DATA, POSITION position-number.

For error code check my next post......

No comments:

Post a Comment