Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: howto convert a binary field entry to varchar ??


Message #1 by "flummi" <flummi@e...> on Tue, 16 Jul 2002 14:03:06
Hi, 

I am not new to SQL but I can't figure out how to copy/convert an entry 
from a binary database field into a varchar field within a SQL-statement.

Ex.: 

> binary field  ->  varchar field
> 0x3FE82B      ->  "3fE82B"

I tried the following: 

> UPDATE Table1 SET field_varchar = convert(field_binary AS BINARY)


Then I tried to loop through the binary field string and copy/convert 
each 'character' in each space to the varchar field but I couldn't get it 
to work either.

Does anybody has an idea? Is there a function call that can do it? Thanx 
for any help.
Flummi

  Return to Index