DB2 SQL Errors Codes and Error Messages and Warnings from Error -245 to -247

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-245, SQLSTATE=428F5, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE INVOCATION OF FUNCTION
routine-name IS AMBIGUOUS
Explanation: DB2 was not able to resolve the
indicated function.
routine-name
The name of the function.
This occurs when an untyped parameter marker is
passed to a function and there are two or more possible
candidate functions to resolve to during function
resolution.
System action: The statement is not processed.
Programmer response: Correct the problem and
reissue the statement. You might need to change the
SQL statement, the definition of a function, or the
user’s SQL path.
SQLSTATE: 428F5

Error: DB2 SQL Error: SQLCODE=-246, SQLSTATE=42873, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
STATEMENT USING CURSOR
cursor-name SPECIFIED NUMBER OF
ROWS num-rows WHICH IS NOT
VALID WITH dimension
Explanation:
A multiple-row FETCH, MERGE, or INSERT statement
is not valid in this context. The statement is invalid
because the number of rows that were specified is not
greater than 0 and not less than or equal to 32767. The
statement can also be invalid if the number of rows
that were specified is greater than the dimension of the
host variable array. The number of rows that were
specified is num-rows, and the dimension of the array is
dimension. If this is a FETCH statement, the cursor
name is cursor-name. Otherwise, the *N is returned for
cursor-name because the cursor name is not applicable.
System action: The statement cannot be processed.
The cursor position is unchanged.
Programmer response: Change the application to
either declare, or allocate a host-variable-array that is
large enough to contain the number of rows specified
in the statement, or update the value of num-rows to a
value within the valid range.
SQLSTATE: 42873

Error: DB2 SQL Error: SQLCODE=-247, SQLSTATE=24519, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
A HOLE WAS DETECTED ON A
MULTIPLE ROW FETCH STATEMENT
USING CURSOR cursor-name, BUT
INDICATOR VARIABLES WERE NOT
PROVIDED TO DETECT THE
CONDITION
Explanation: A hole was detected on a FETCH
statement for multiple rows of data, but no indicator
variables were provided to reflect the situation to the
application.
System action: The statement cannot be processed.
Programmer response: Change the FETCH statement
to provide at least one indicator variable, and resubmit
the statement.
SQLSTATE: 24519

Above are list of DB2 SQL Errors and Warnings from Error -245 to -247 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 *