DB2 - Problem description
Problem IC63612 | Status: Closed |
EXECUTION OF STORED PROCEDURE ON Z/OS WITH NULL INPUT PARAMETER INSERTS STRING "NULL" INSTEAD OF NULL VALUE | |
product: | |
DB2 FOR LUW / DB2FORLUW / 950 - DB2 | |
Problem description: | |
When executing a Stored Procedure on z/OS DB2 when input parameter is null, this will result with string NULL inserted as opposed to a null character. For example. db2 => create procedure sptest2(IN id char(20)) language sql begin insert into test values (id, 10); end db2 call sptest2(null) db2 select * from test A B -------- ----------- null 10 ===> A string "null" value is inserted If you instead insert into the table insert into test values (null, 8) ===> this actually inserts a SQL null value in the table db2 select * from test A B -------- ----------- - 8 ==> The "-" is showing as null under column "A" So the null character is shown and not the string null. | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * Users connecting to Z/OS DB2 to run Stored Procedures * **************************************************************** * PROBLEM DESCRIPTION: * * When executing a Stored Procedure on z/OS DB2 when input * * * * parameter is null, this will result with string NULL * * inserted as * * opposed to a null character. * * * * * * * * For example. * * * * db2 => create procedure sptest2(IN id char(20)) language sql * * * * begin insert into test values (id, 10); end * * * * * * * * db2 call sptest2(null) * * * * * * * * db2 select * from test * * * * * * * * A B * * * * -------- ----------- * * * * null 10 ===> A string * * * * "null" value is inserted * * * * * * * * If you instead insert into the table * * * * * * * * insert into test values (null, 8) ===> this actually * * inserts a * * SQL null value in the table * * * * * * * * db2 select * from test * * * * * * * * A B * * * * -------- ----------- * * * * - 8 ==> The "-" is * * showing * * as null under column "A" * * * * * * * * So the null character is shown and not the string null. * **************************************************************** * RECOMMENDATION: * * Upgrade to Version 9.5 Fixpak 5 * **************************************************************** | |
Local Fix: | |
available fix packs: | |
DB2 Version 9.5 Fix Pack 5 for Linux, UNIX, and Windows | |
Solution | |
Problem first fixed in Version 9.5 Fixpak 5. | |
Workaround | |
not known / see Local fix | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 07.10.2009 06.01.2010 06.01.2010 |
Problem solved at the following versions (IBM BugInfos) | |
9.5. | |
Problem solved according to the fixlist(s) of the following version(s) | |
9.1.0.9 | |
9.5.0.5 |