IBM Support

IT35309: DYNAMIC QUERY EXECUTION FAILS WITH SQLCODE SQL0901N REASON CODE "CONSTANT OF UNSUPPORTED TYPE"

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • A dynamic query may fail at execution time with SQLCODE -901
    and reason code "Constant of unsupported type".  This can occur
    when all the following are true:
    
    - REOPT ONCE is enabled
    - The statement includes at least one REOPT supported variable
    - The query references an array global variable
    
    For example:
    
       create table t (c int);
       create type intarray as int array[2];
       create variable arrayvar intarray;
       creaet variable intVar int default 2;
    
       set arrayvar[2] = 200;
    
       call set_routine_opts('REOPT ONCE');
    
       create procedure P
       language sql
       begin atomic
        declare stmtText varchar(1024) default 'delete from t where
    c = arrayvar[2] or c =intVar'; --
        prepare stmt from stmtText; --
        execute stmt; --
       end;
    
       call P();
       SQL0901N  The SQL statement or command failed because of a
    database system
       error. (Reason "Constant of unsupported type".)
    SQLSTATE=58004
    

Local fix

  • Disable REOPT ONCE.
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * ALL                                                          *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to Db2 version 11.5.6.0                              *
    ****************************************************************
    

Problem conclusion

  • First fixed in Db2 version 11.5.6.0
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT35309

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    B50

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2020-12-17

  • Closed date

    2021-06-21

  • Last modified date

    2021-06-28

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

    IT28266

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

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

  • RB50 PSN

       UP

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"DB2 for Linux- UNIX and Windows"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.5","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
17 December 2021