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

EXPRESSIONS DEFINED AS CHAR() WITH BIT DATA IN A CURSOR RETURNED FROM A
STORED PROCEDURE MISS BIT DATA INFORMATION

product:
DB2 FOR LUW / DB2FORLUW / 970 - DB2
Problem description:
The following query: 
 
     SELECT cast(x'619e0000b58d0101' as char(8) for bit data) 
 
      FROM sysibm.sysdummy1 
 
 
 
comes back to the client indicating the results are CHAR(8) FOR 
BIT DATA 
 
 
However, when run as: 
 
 
 
   create or replace procedure p1 () 
 
   dynamic result sets 1 
 
   BEGIN 
 
       DECLARE a CHAR(8) FOR BIT DATA; 
 
 
 
       DECLARE cur_sel_1 CURSOR 
 
            WITH RETURN TO CLIENT 
 
            WITH HOLD 
 
       FOR 
 
           SELECT a FROM SYSIBM.SYSDUMMY1; 
 
 
 
       SELECT cast(x'619e0000b58d0101' as char(8) for bit data) 
 
         INTO a 
 
         FROM SYSIBM.SYSDUMMY1; 
 
 
 
       OPEN cur_sel_1; 
 
   END 
 
 
 
The column expression type is returned as CHAR(8) and the binary 
information is incorrectly interpreted/converted.
Problem Summary:
**************************************************************** 
* USERS AFFECTED:                                              * 
* All                                                          * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* The following query:                                         * 
*                                                              * 
*                                                              * 
*                                                              * 
* SELECT cast(x'619e0000b58d0101' as char(8) for bit data)     * 
*                                                              * 
*                                                              * 
*                                                              * 
* FROM sysibm.sysdummy1                                        * 
*                                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
* comes back to the client indicating the results are CHAR(8)  * 
* FOR                                                          * 
* BIT DATA                                                     * 
*                                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
* However, when run as:                                        * 
*                                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
* create or replace procedure p1 ()                            * 
*                                                              * 
*                                                              * 
*                                                              * 
* dynamic result sets 1                                        * 
*                                                              * 
*                                                              * 
*                                                              * 
* BEGIN                                                        * 
*                                                              * 
*                                                              * 
*                                                              * 
* DECLARE a CHAR(8) FOR BIT DATA;                              * 
*                                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
* DECLARE cur_sel_1 CURSOR                                     * 
*                                                              * 
*                                                              * 
*                                                              * 
* WITH RETURN TO CLIENT                                        * 
*                                                              * 
*                                                              * 
*                                                              * 
* WITH HOLD                                                    * 
*                                                              * 
*                                                              * 
*                                                              * 
* FOR                                                          * 
*                                                              * 
*                                                              * 
*                                                              * 
* SELECT a FROM SYSIBM.SYSDUMMY1;                              * 
*                                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
* SELECT cast(x'619e0000b58d0101' as char(8) for bit           * 
* data)                                                        * 
*                                                              * 
*                                                              * 
* INTO a                                                       * 
*                                                              * 
*                                                              * 
*                                                              * 
* FROM SYSIBM.SYSDUMMY1;                                       * 
*                                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
* OPEN cur_sel_1;                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
* END                                                          * 
*                                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
*                                                              * 
* The column expression type is returned as CHAR(8) and the    * 
* binary                                                       * 
* information is incorrectly interpreted/converted.            * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Upgrade to Db2 9.7 Fix Pack 5                                * 
****************************************************************
Local Fix:
When returning a cursor for the query below 
 
    SELECT a FROM SYSIBM.SYSDUMMY1 
 
The workaround is to cast the result column: 
 
    DECLARE cur_sel_1 CURSOR 
         WITH RETURN TO CLIENT 
         WITH HOLD 
    FOR 
        SELECT cast( a as char(8) for bit data ) FROM 
SYSIBM.SYSDUMMY1; --
available fix packs:
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 8 for Linux, UNIX, and Windows
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
First fixed in DB2 9.7 Fix Pack 5
Workaround
not known / see Local fix
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
19.04.2011
15.02.2012
15.02.2012
Problem solved at the following versions (IBM BugInfos)
9.7.FP5
Problem solved according to the fixlist(s) of the following version(s)
9.7.0.5 FixList