IBM Support

Error SQL1188N returned when a DB2 LOAD from a cursor is executed when the declare cursor select list has NULL values in place of decimal columns in the target table.

Troubleshooting


Problem

A DB2 LOAD from a cursor might fail with an SQL1188N error if there are NULL values for the decimal data types in the select list of the declare cursor statement.

Symptom

When attempting a LOAD from a cursor and the 'declare cursor' select list has NULLs for the decimal data types the subsequent LOAD, using the previously defined cursor, might fail with an SQL1188N error:

These are some example table definitions with decimals:

db2 "create table tab1 (col1 varchar(10), col2 timestamp)"
db2 "create table tab2 (col1 varchar(10), col2 timestamp, col3 varchar(3), col4 decimal(10,0), col5 timestamp)"

Declare the cursor definition:
db2 "declare curs cursor for select col1, col2, null, null, null from tab1"

LOAD from that cursor:
db2 "load from curs of cursor messages load_cursor.txt insert into tab2 nonrecoverable"

SQL1188N Column "4" of the SELECT or VALUES statement is not compatible with
table column "4". The source column has sqltype "448", and the target column
has sqltype "484".

Other data types like BIGINT could be affected too.

[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Data Movement - Load","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.7;10.1;10.5","Edition":"Advanced Enterprise Server;Advanced Workgroup Server;Enterprise Server;Express;Express-C;Personal;Workgroup Server","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Document Information

Modified date:
30 April 2025

UID

swg21982183