Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

binary2char without really converting the value...

2 posts in General Discussion Last posting was on 2012-11-15 17:38:42.0Z
binary2char Posted on 2012-11-15 17:32:52.0Z
Sender: 5918.50a5082c.1804289383@sybase.com
From: binary2char
Newsgroups: sybase.public.ase.general
Subject: binary2char without really converting the value...
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <50a52744.6206.1681692777@sybase.com>
NNTP-Posting-Host: 172.20.134.41
X-Original-NNTP-Posting-Host: 172.20.134.41
Date: 15 Nov 2012 09:32:52 -0800
X-Trace: forums-1-dub 1353000772 172.20.134.41 (15 Nov 2012 09:32:52 -0800)
X-Original-Trace: 15 Nov 2012 09:32:52 -0800, 172.20.134.41
Lines: 15
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:31497
Article PK: 74387

I have a table with binary column.
this has vaues like 0x00000000110010105d430000.

is it possible to get the 0x00000000110010105d430000 as
string in another variable? If I use convert it does actual
conversion. I am intersted in '00000000110010105d430000'
which I can concat with other string values.

1> select convert(varchar(28),0x00000000110010105d430000)
2> go
----------------------------
&#9668; &#9658;&#9658;]C

I created unix script for my task to work but was wondering
if this can be done purely using TSQL?


Rob V Posted on 2012-11-15 17:38:42.0Z
From: Rob V <rob@sypron.nl>
Reply-To: rob@sypron.nl
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
Newsgroups: sybase.public.ase.general
Subject: Re: binary2char without really converting the value...
References: <50a52744.6206.1681692777@sybase.com>
In-Reply-To: <50a52744.6206.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <50a528a2@forums-1-dub>
Date: 15 Nov 2012 09:38:42 -0800
X-Trace: forums-1-dub 1353001122 172.20.134.152 (15 Nov 2012 09:38:42 -0800)
X-Original-Trace: 15 Nov 2012 09:38:42 -0800, vip152.sybase.com
Lines: 45
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:31498
Article PK: 74386


On 15-Nov-2012 18:32, binary2char wrote:
> I have a table with binary column.
> this has vaues like 0x00000000110010105d430000.
>
> is it possible to get the 0x00000000110010105d430000 as
> string in another variable? If I use convert it does actual
> conversion. I am intersted in '00000000110010105d430000'
> which I can concat with other string values.
>
> 1> select convert(varchar(28),0x00000000110010105d430000)
> 2> go
> ----------------------------
> &#9668; &#9658;&#9658;]C
>
> I created unix script for my task to work but was wondering
> if this can be done purely using TSQL?
>

1> select bintostr(0x00000000110010105d430000)
2> go

------------------------
00000000110010105d430000

(1 row affected)


--
HTH,

Rob V.
-----------------------------------------------------------------
Rob Verschoor

Certified Professional DBA for Sybase ASE, IQ, Replication Server

Author of Sybase books (order online at www.sypron.nl/shop):
"Tips, Tricks & Recipes for Sybase ASE"
"The Complete Sybase IQ Quick Reference Guide"
"The Complete Sybase ASE Quick Reference Guide"
"The Complete Sybase Replication Server Quick Reference Guide"

rob@NO.SPAM.sypron.nl | www.sypron.nl | Twitter: @rob_verschoor
Sypron B.V., The Netherlands | Chamber of Commerce 27138666
-----------------------------------------------------------------