home clear 64x64
en blue 200x116 de orange 200x116 info letter User
suche 36x36
Latest versionsfixlist
11.1.0.7 FixList
10.5.0.9 FixList
10.1.0.6 FixList
9.8.0.5 FixList
9.7.0.11 FixList
9.5.0.10 FixList
9.1.0.12 FixList
Have problems? - contact us.
Register for free anmeldung-x26
Contact form kontakt-x26

DB2 - Problem description

Problem IC90604 Status: Closed

IMPORT NULL VALUE TO A COLUMN THAT IS A PART OF PRIMARY KEY WITH
INSERT_UPDATE AND USEDEFAULTS OPTIONS WILL COMPLAIN -206 ERROR.

product:
DB2 FOR LUW / DB2FORLUW / 970 - DB2
Problem description:
During the import with insert_update and usedefaults options, if 
a column is a part of the primary key and this corresponding 
column in the source file has no explicit column data, e.g NULL, 
the import command will complain as below: 
 
SQL3015N  An SQL error "-206" occurred during processing. 
 
SQL0206N  "DEFAULT" is not valid in the context where it is 
used. 
SQLSTATE=42703 
 
Below are the steps of problem reproduction: 
 
1. Create a table and primary key 
 
 
db2 "create table alantest (col1 varchar(10) NOT NULL, col2 
varchar(10) NOT NULL DEFAULT 'HJP',col3 varchar(5) NOT NULL)" 
 
 
 
db2 "alter table alantest add primary key(col1,col2)" 
 
2. Edit an import file named alantest.del which get the col2 had 
NULL value 
 
aaa,,ccc 
 
3. For table alantest run 
 
db2 import from alantest.del of del modified by usedefaults 
insert_update into alantest 
 
--This will succeed. 
 
db2 import from alantest.del of del modified by usedefaults 
insert_update into alantest 
 
 
--This time it will fail with SQL3015N
Problem Summary:
**************************************************************** 
* USERS AFFECTED:                                              * 
* ALL USERS                                                    * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* See Error Description                                        * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Upgrade to v9.7 FP9 or use localfix as a workaround.         * 
****************************************************************
Local Fix:
Modify the source file to replace the NULL to an explicit value. 
OR 
Redefine the primary key -- db2 "alter table alantest add 
primary key(col1)"
available fix packs:
DB2 Version 9.7 Fix Pack 9 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 9a for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 10 for Linux, UNIX, and Windows

Solution
This problem has been fixed in v9.7 FP9
Workaround
not known / see Local fix
BUG-Tracking
forerunner  : APAR is sysrouted TO one or more of the following: IC91801 IC95216 
follow-up : 
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
03.03.2013
17.12.2013
17.12.2013
Problem solved at the following versions (IBM BugInfos)
9.7.FP9
Problem solved according to the fixlist(s) of the following version(s)
9.7.0.9 FixList
9.7.0.9 FixList