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 IC64198 Status: Closed

SQL901 (REASON "COLUMN NUMBER OUT OF RANGE".) WHILE SELECTING
DATA FROM TABLE AFTER DROPPING SOME COLUMNS.

product:
DB2 FOR LUW / DB2FORLUW / 970 - DB2
Problem description:
DB2 throws SQL901 (Reason "column number out of range".) while 
selecting data from table after dropping some columns. 
 
Test case: 
 
 
drop table sample.tab1; 
 
create table sample.tab1 
  ( c1 int, 
    c2 int, 
    c3 int not null, 
    c4 int not null, 
    ref_c3 int, 
    ref_c4 int, 
    primary key (c3, c4) 
  ); 
 
alter table sample.tab1 
  add constraint self_ref_fk foreign key 
  (ref_c3, ref_c4) references sample.tab1 (c3, c4) 
  on update restrict 
  on delete restrict; 
 
insert into sample.tab1 (c3, c4, ref_c3, ref_c4) 
   values (1, 2, 1, 2); 
 
alter table sample.tab1 drop column c1; 
 
reorg table sample.tab1; 
 
insert into sample.tab1 (c3, c4, ref_c3, ref_c4) 
   values (3, 4, 3, 4); 
 
The last insert statement fails with: 
insert into sample.tab1 (c3, c4, ref_c3, ref_c4) values (3, 4, 
3, 4) 
DB21034E  The command was processed as an SQL statement because 
it was not a 
valid Command Line Processor command.  During SQL processing it 
returned: 
SQL0530N  The insert or update value of the FOREIGN KEY 
"SAMPLE.TAB1.SELF_REF_FK" is not equal to any value of the 
parent key of the 
parent table.  SQLSTATE=23503 
 
However, it SHOULD have been able to insert the row! 
 
Another symptom of this problem can be the -901.
Problem Summary:
**************************************************************** 
* USERS AFFECTED:                                              * 
* Users prior to DB2 V97 FP2                                   * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* SQL901 (REASON "COLUMN NUMBER OUT OF RANGE".)                * 
* WHILESELECTINGDATA FROM TABLE AFTER DROPPING SOME COLUMNS.   * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Upgrade to DB2 V97 FP2.                                      * 
****************************************************************
Local Fix:
available fix packs:
DB2 Version 9.7 Fix Pack 2 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 3 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 3a for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 4 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 5 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 6 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 7 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 9a for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 8 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 9 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 10 for Linux, UNIX, and Windows

Solution
Problem is first fixed in DB2 V97 FP2. 
Upgrade to DB2 V97 FP2.
Workaround
not known / see Local fix
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
27.10.2009
22.06.2010
22.06.2010
Problem solved at the following versions (IBM BugInfos)
9.7.FP2
Problem solved according to the fixlist(s) of the following version(s)
9.7.0.2 FixList