Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

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:// - I suspect a search on
for "inttohex" will turn it up).

Michael Peppler - Data Migrations Inc. - -
International Sybase User Group -