DB2 SQL Errors Codes and Error Messages and Warnings from Error +237 to +239

SQLServerF1

Error: DB2 SQL Error: SQLCODE=+237, SQLSTATE=01594, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
SQLDA INCLUDES integer1 SQLVAR
ENTRIES, BUT integer2 ARE
REQUIRED BECAUSE AT LEAST ONE
OF THE COLUMNS BEING
DESCRIBED IS A DISTINCT TYPE
Explanation: Given that at least one of the columns
being described is a distinct type, space should be
provided for the extended SQLVAR entries in addition to
the base SQLVAR entries. The value of SQLN, integer1,
indicates that there are not enough SQLVAR entries for
the base and extended SQLVAR entries.
The total number of SQLVAR entries that are required
depends on whether USING BOTH was specified (n is
the number of columns being described):
v With USING BOTH, space should be allocated for 3n
SQLVAR entries.
v Otherwise, space should be allocated for 2n SQLVAR
entries.
The number of SQLVAR entries that are needed to
return all of the information about the columns is
integer2.
Attention: In the case of DESCRIBE INPUT, each
reference to column would actually be parameter.
System action: DB2 has set the SQLDAID 7th byte
flag “on” because sufficient space was not provided for
the extended SQLVAR entries. The value of the 7th byte
flag indicates how many SQLVAR entries are needed
for each column. Additionally, because there were
enough SQLVAR entries for the base SQLVARs, DB2 has
set the fields of the base SQLVAR entries. However, DB2
has not set any extended SQLVAR entries.
Programmer response: If there is no need for the
additional information about the distinct type(s), then
no action is required unless USING BOTH was
specified (in which case additional SQLVAR entries
must be provided for the labels).
If the distinct type information is needed, the value of
the SQLN field in the SQLDA should be increased to
integer2 (after making sure that the SQLDA is large
enough to support that amount) and the statement
should be resubmitted.
SQLSTATE: 01594

Error: DB2 SQL Error: SQLCODE=+238, SQLSTATE=01005, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
SQLDA INCLUDES integer1 SQLVAR
ENTRIES, BUT integer2 SQLVAR
ENTRIES ARE NEEDED FOR integer3
COLUMNS BECAUSE AT LEAST ONE
OF THE COLUMNS BEING
DESCRIBED IS A LOB
Explanation: Given that at least one the columns
being described is a LOB, space must be provided for
the extended SQLVAR entries in addition to the base
SQLVAR entries. The value of SQLN, integer1, indicates
that there are not enough SQLVAR entries for the base
and extended SQLVAR entries. One or more of the
columns being described may be a distinct type.
The total number of SQLVAR entries that are required
depends on whether USING BOTH was specified or
not (n is the number of columns being described which
is integer3), and whether the columns include any
distinct types:
v With USING BOTH, and one or more distinct types,
space should be allocated for 3n SQLVAR entries.
v Otherwise, space should be allocated for 2n SQLVAR
entries.
The number of SQLVAR entries that are needed to
return all of the information about the columns is
integer2.
Important: In the case of DESCRIBE INPUT, each
reference to column would actually be parameter.
System action: DB2 has set the SQLDAID 7th byte
flag “on” because sufficient space was not provided for
the extended SQLVAR entries. The value of the 7th byte
flag indicates how many SQLVAR entries are needed
for each column. DB2 has not set any SQLVAR entries.
Programmer response: Increase the value of the SQLN
field in the SQLDA to integer2 (after making sure that
the SQLDA is large enough to support that amount)
and resubmit the statement.
SQLSTATE: 01005

Error: DB2 SQL Error: SQLCODE=+239, SQLSTATE=01005, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
SQLDA INCLUDES integer1 SQLVAR
ENTRIES, BUT integer2 ARE
REQUIRED FOR integer3 COLUMNS
BECAUSE AT LEAST ONE OF THE
COLUMNS BEING DESCRIBED IS A
DISTINCT TYPE
Explanation: Given that at least one of the columns
being described is a distinct type, space should be
provided for the extended SQLVAR entries in addition to
the base SQLVAR entries. The value of SQLN, integer1,
indicates that there are not enough SQLVAR entries for
the base and extended SQLVAR entries.
The total number of SQLVAR entries that are required
depends on whether USING BOTH was specified or
not (n is the number of columns being described which
is integer3),
v With USING BOTH, space should be allocated for 3n
SQLVAR entries.
v Otherwise, space should be allocated for 2n SQLVAR
entries.
The number of SQLVAR entries that are needed to
return all of the information about the columns is
integer2.
Note: in the case of DESCRIBE INPUT, each reference
to column would actually be parameter.
System action: DB2 has set the SQLDAID 7th byte
flag “on” because sufficient space was not provided for
the extended SQLVAR entries. The value of the 7th byte
flag indicates how many SQLVAR entries are needed
for each column. DB2 has not set any SQLVAR entries.
:elq.
Programmer response: If the distinct type information
is needed, the value of the SQLN field in the SQLDA
should be increased to integer2 (after making sure the
SQLDA is large enough to support that amount) and
the statement should be resubmitted.
If there is no need for the additional information about
the distinct type(s) in the result set, then it is possible
to resubmit the statement only providing enough
SQLVAR entries to accommodate the number of
columns being described (i.e. provide the necessary
number of base SQL entries).
SQLSTATE: 01005

Above are list of DB2 SQL Errors and Warnings from Error +237 to +239 received while performing certain operation against DB2 Database or related products.

SQLCODE – Regardless of whether the application program provides an SQLCA or a stand-alone variable, SQLCODE is set by DB2 after each SQL statement is
executed. DB2 conforms to the ISO/ANSI SQL standard as follows:
If SQLCODE = 0, execution was successful.
If SQLCODE > 0, execution was successful with a warning.
If SQLCODE < 0, execution was not successful.
SQLCODE = 100, “no data” was found. For example, a FETCH statement returned no data because the cursor was positioned after the last row of the result table.

SQLSTATE – SQLSTATE is also set by DB2 after the execution of each SQL statement. Thus, application programs can check the execution of SQL statements by testing SQLSTATE instead of SQLCODE.

Hope this was helpful.

Thanks,
SQLServerF1 Team
Information about DB2 SQL Error Codes and Error Messages on Windows, Linux and Z/OS Operating Systems.

 

Leave a Reply

Your email address will not be published. Required fields are marked *