IBM Support

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

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error 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.
    

Local fix

Problem summary

  • DB2 throws SQL901 (Reason "column number out of range".) while
    
    selecting data from table after dropping some columns.
    

Problem conclusion

  • Problem is first fixed in DB2 V95 FP6.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI74973

  • Reported component name

    DB2 UDE ESE LIN

  • Reported component ID

    5765F4104

  • Reported release

    950

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2009-10-06

  • Closed date

    2009-10-28

  • Last modified date

    2009-10-28

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

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

    LI74992 IC64198

Fix information

  • Fixed component name

    DB2 UDE ESE LIN

  • Fixed component ID

    5765F4104

Applicable component levels

  • R950 PSY

       UP

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSEPGG","label":"DB2 for Linux, UNIX and Windows"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"950","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
28 October 2009