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

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error 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
    

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)"
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * ALL USERS                                                    *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to v9.7 FP9 or use localfix as a workaround.         *
    ****************************************************************
    

Problem conclusion

  • This problem has been fixed in v9.7 FP9
    

Temporary fix

Comments

APAR Information

  • APAR number

    IC90604

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    970

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-03-03

  • Closed date

    2013-12-17

  • Last modified date

    2013-12-17

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

    IC91801 IC95216

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

  • R970 PSN

       UP



Rate this page:

(0 users)Average rating

Document information


More support for:

DB2 for Linux, UNIX and Windows

Software version:

9.7

Reference #:

IC90604

Modified date:

2013-12-17

Translate my page

Machine Translation

Content navigation