If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Serious problem with UNICODE

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-29-11, 08:28
sstublja sstublja is offline
Registered User
 
Join Date: Mar 2011
Posts: 1
Serious problem with UNICODE

Here's the problem.
Stored procedure has 2 input parameters, X and Y.
Procedure creates another variable Z.
Value of parameters X and Y is the same- ÑÀÚËÏÝĈĞŦŞǙ ( yes, this are real letters!).

During parameter handling through procedure, value of parameter X is stored in varijable Z

SET Z=X;

and parameter Y and variable Z are inserted in database table.


INSERT Z,Y into table where etc,etc,etc.....

Table columns are defined as UNICODE (with purpose to support those kind of letters!)


Input parameters X and Y are varchar(50)
(IN X VARCHAR(50), IN Y VARCHAR(50))


variable Z is defined as
DECLARE Z VARCHAR(50) CCSID UNICODE;


Procedure itself is defined as


CREATE PROCEDURE TEST.M19TEST (
IN X VARCHAR(50),
IN Y VARCHAR(50))


ASUTIME LIMIT 1 RESULT SETS 1
LANGUAGE SQL
FENCED
COLLID M19OMATI
PARAMETER CCSID UNICODE
WLM ENVIRONMENT T0DBWLOW
RUN OPTIONS 'NOTEST(NONE,*,*,*)'


so, everything is UNICODE defind (or am I missing something???)

But, after insert i got different value in database table. Input parameter Y is inserted fine (ÑÀÚËÏÝĈĞŦŞǙ),while variable Z is not, it does not support those kind of lettersm i only get a lot of garbage.( ÚË Ý Ş ).

Further testing it, I came to conclusion that the encoding is lost while setting variable Z with value of parameter X.

SET Z=X;

So, to conclude, parameter Y is inserted fine because stored procedure only stores input value of Y, while X is first 'copied' to Z, and then Z is inserted.
If any operation is done with input data, it loses encoding.

Any ideas? suggestions? Please, I'm desperate!


Thank you very much


P.S. we are using zOS and DB2 v9
Reply With Quote
  #2 (permalink)  
Old 03-29-11, 08:45
dr_te_z dr_te_z is offline
Registered User
 
Join Date: Jan 2009
Location: Zoetermeer, Holland
Posts: 555
Wild guess: try VARCHRAPHIC instead of VARCHAR
Reply With Quote
Reply

Tags
stored procedure, unicode problems

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On