5 pts.
 DB2/400 field to match an Oracle VARCHAR?
We are having trouble trying to use a 255 byte key in DB2/400 DDS specs. We use Oracle VARCHAR keys 255 bytes long all the time. How do we specify a DB2/400 key to be like an Oracle VARCHAR? Note: in an Oracle VARCHAR the trailing spaces are compressed out. In a pure 255 DDS field, apparently any data to the right of the real data inserted becomes spaces? How do we get our Oracle Data Model requiring VARCHAR 255 keys to work on an AS/400? Note the key works from AS/400 programs and commands, it is failing IBM DB2 ODBC client server access. We can insert from the varchar, but afterwards we cannot query back out of the DB2/400 without a terminal error.

Software/Hardware used:
ASKED: April 5, 2009  9:03 PM
UPDATED: May 18, 2009  11:17 PM

Answer Wiki:
Hi, The equivalent VARCHAR for DDS is Keyword VARLEN. DB2/400 uses a 2 bytes prefix to store the real length of data and if you are using a 255 bytes VARCHAR you will define <pre> A KEY 255A <b>VARLEN</b> </pre> It will use 2 additional bytes to store the data on disk. I hope it will help you. Regards, Wilson
Last Wiki Answer Submitted:  May 18, 2009  11:17 pm  by  WilsonAlano   2,385 pts.
All Answer Wiki Contributors:  WilsonAlano   2,385 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _