Up Prev Next
From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: Sybase Question
Date: Jan 24 2002 9:30PM
Jain, Mohit S writes:
> The problem is the resultset that is generated by the stored proc has a
> field with a binary(16) datatype. Since this application does not have
> support for binary datatypes it generates an error.
> I need to run this stored proc and convert that value into a format that my
> application will understand and store it. I would also need to reconvert it
> back to binary format when I return some value back to the Sybase database.
> I have tried "select convert(char(255), binary_field) from table_name"
Take a look at the intohex() function - however as it name implies
this works on 4 byte integers, so you have to use 4 byte substrings of
the binary field and then concatenate them back together (I think -
there was a post on this same subject in one of the newsgroups at
news://forums.sybase.com/ - I suspect a search on groups.google.com
for "inttohex" will turn it up).
Michael Peppler - Data Migrations Inc. - http://www.mbay.net/~mpeppler
firstname.lastname@example.org - email@example.com
International Sybase User Group - http://www.isug.com