Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Location
    Ottawa
    Posts
    21

    Unanswered: Display value from an HEX column in character format

    Hi, I stored some values in a column as a VARCHAR FOR BIT DATA and would like to view the value of the column, not in HEX but in character format. Is their a way to do a select on the column to do this?

    We use UDB version 7.2 on Windows NT 4.

    Thanks.
    Mbourd25

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    You can try the cast function, but I am not 100% sure it will work, and I don't know for sure if it is supported in version 7.

    select cast(column-name as char(10)) ...
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Mar 2004
    Location
    Ottawa
    Posts
    21
    Hi Marcus_A, I tried using the cast function to convert the data from a HEX format to a CHAR format and it didn't work. The weird thing that I found out is when I ran this SQL, SELECT CAST(XML_DATA_TXT AS CHAR(1)) FROM VAPXMT1, I get a warning message that my data is truncated but at the end of the warning message, I can see the value that was stored in CHAR format.

    Would their be another way to display the VARCHAR FOR BIT DATA as the value that inserted?

    Thanks.
    Mbourd25

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    I don't know, but I would keeping making the CHAR bigger and see if that helps avoid the truncation message.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •