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