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 > Display value from an HEX column in character format

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-31-06, 15:49
mbourd25 mbourd25 is offline
Registered User
 
Join Date: Mar 2004
Location: Ottawa
Posts: 21
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
Reply With Quote
  #2 (permalink)  
Old 01-31-06, 20:49
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
  #3 (permalink)  
Old 02-01-06, 10:25
mbourd25 mbourd25 is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 02-01-06, 21:52
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
Reply

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