Hi,
I have a requirement
To extract varbinary fields from a table say X , do some manipualtions and inset the changed record in same table X.
But the problem is varbinary fields are getting changed
For eg in source table the field is like 202020 , when i extracted them to seq file they were becoming as 323032303230 . I tried putting convert(varchar,value)
function but this time empty spaces were coming .
I am using sysbase db.
Thanks in advance
conversion from varbinary to varchar
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
323032303230 is the hex equivalent of "202020". So, somewhere, a "raw to hex" conversion was being performed, either automatically because you're reading it into a VarChar or because you asked for it somehow.
You can convert this back to raw (VarBinary) form using Oconv() with "MY" as the conversion specification. You can convert it to a string equivalent using Iconv() with "MX0C" as the conversion specification.
You can convert this back to raw (VarBinary) form using Oconv() with "MY" as the conversion specification. You can convert it to a string equivalent using Iconv() with "MX0C" as the conversion specification.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod wrote:323032303230 is the hex equivalent of "202020". So, somewhere, a "raw to hex" conversion was being performed, either automatically because you're reading it into a VarChar or because you asked for it ...
hi,
Got it , i converted it explicitly to hex using iconv function
Thanks for you insight in the problem :D