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

SQL0303N DURING EXECUTION OF SQL STORED PROCEDURE THAT INVOLVES THE
CONVERSION BETWEEN CHAR TYPES AND NCHAR/GRAPHIC TYPES

product:
DB2 FOR LUW / DB2FORLUW / A10 - DB2
Problem description:
Execution of the SQL stored procedure fails with SQL0303N error 
if it involves conversion between CHAR types and NCHAR/GRAPHIC 
types for UTF-8 databases. 
 
SQL0303N  A value cannot be assigned to a host variable in the 
SELECT, VALUES, FETCH or assignment statement because the data 
types are  not compatible. 
 
Sample: 
 
Execution of the following stored procedure fails with SQL0303N 
error: 
 
create procedure prc1( IN action integer,INOUT p2 nvarchar(240)) 
BEGIN 
  declare wiac_var nvarchar(240); 
  DECLARE lec_amrapp CURSOR WITH HOLD 
  FOR 
  SELECT 'X' FROM sysibm.dual ; 
   OPEN lec_amrapp; 
   FETCH lec_amrapp INTO wiac_var; 
   CLOSE lec_amrapp; 
   set p2=wiac_var; 
   return 1; 
END 
@ 
 
C:\Program Files\IBM\ESEV975\BIN>db2 call prc1(1,'a') 
SQL0303N  A value cannot be assigned to a host variable in the 
SELECT, VALUES, 
FETCH or assignment statement because the data types are not 
compatible. 
SQLSTATE=42806 
 
 
Here is a summary of conversions that we will support for this 
APAR : 
 
CHAR/VARCHAR to and from GRAPHIC/VARGRAPHIC/NCHAR/NVARCHAR in 
Unicode 
Databases only  (1208->1200).
Problem Summary:
**************************************************************** 
* USERS AFFECTED:                                              * 
* All                                                          * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* See Apar Description                                         * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Upgrade to v97fp6                                            * 
**************************************************************** 
Users affected: All 
Problem details: Execution of the SQL stored procedure fails 
with SQL0303N error 
if it involves conversion between CHAR types and NCHAR/GRAPHIC 
types for UTF-8 databases.
Local Fix:
Use the same  data type to avoid conversion. 
 
For above testcase use 
 
SELECT N'X' FROM sysibm.dual;
available fix packs:
DB2 Version 10.1 Fix Pack 1 for Linux, UNIX, and Windows
DB2 Version 10.1 Fix Pack 2 for Linux, UNIX, and Windows
DB2 Version 10.1 Fix Pack 3 for Linux, UNIX, and Windows
DB2 Version 10.1 Fix Pack 4 for Linux, UNIX, and Windows
DB2 Version 10.1 Fix Pack 3a for Linux, UNIX, and Windows
DB2 Version 10.1 Fix Pack 6 for Linux, UNIX, and Windows

Solution
First fixed in v9.7fp6
Workaround
Use the same  data type to avoid conversion.
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
13.06.2012
20.11.2012
20.11.2012
Problem solved at the following versions (IBM BugInfos)
9.7.FP6
Problem solved according to the fixlist(s) of the following version(s)
10.1.0.1 FixList
10.5.0.1 FixList