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.

binary col

2 posts in General Discussion Last posting was on 2010-02-04 14:32:33.0Z
Steve Posted on 2010-02-04 03:28:37.0Z
Sender: 5ea5.4b67836f.1804289383@sybase.com
From: Steve
Newsgroups: sybase.public.ase.general
Subject: binary col
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4b6a3ee5.3a96.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 3 Feb 2010 19:28:37 -0800
X-Trace: forums-1-dub 1265254117 10.22.241.41 (3 Feb 2010 19:28:37 -0800)
X-Original-Trace: 3 Feb 2010 19:28:37 -0800, 10.22.241.41
Lines: 2
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:28945
Article PK: 78186

i have a binary column of length 4 ( 4 bytes ). I want to
extract 2nd byte how can i do it in ASE?


Rob V [ Sybase ] Posted on 2010-02-04 14:32:33.0Z
Reply-To: "Rob V [ Sybase ]" <robv@DO.NOT.SPAM.sypron.nl.REMOVE.THIS.DECOY>
From: "Rob V [ Sybase ]" <robv@DO.NOT.SPAM.sypron.nl.REMOVE.THIS.DECOY>
Newsgroups: sybase.public.ase.general
References: <4b6a3ee5.3a96.1681692777@sybase.com>
Subject: Re: binary col
Lines: 45
Organization: Sypron BV / TeamSybase / Sybase
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4b6ada81$1@forums-1-dub>
Date: 4 Feb 2010 06:32:33 -0800
X-Trace: forums-1-dub 1265293953 10.22.241.152 (4 Feb 2010 06:32:33 -0800)
X-Original-Trace: 4 Feb 2010 06:32:33 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:28948
Article PK: 78190

Use substring():

1> declare @b binary(8)
2> set @b = 0x0102030405060708
3> select @b
4> select substring(@b, 2,1)
5> go
(1 row affected)

--------------------
0x0102030405060708

(1 row affected)

------
0x02

(1 row affected)


HTH,

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

Certified Sybase Professional DBA for ASE 15.0/12.5/12.0/11.5/11.0
and Replication Server 15.0.1/12.5 // TeamSybase

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

mailto:rob@YOUR.SPAM.sypron.nl.NOT.FOR.ME
http://www.sypron.nl
Sypron B.V., Amersfoort, The Netherlands
Chamber of Commerce 27138666
-----------------------------------------------------------------

<Steve> wrote in message news:4b6a3ee5.3a96.1681692777@sybase.com...
>i have a binary column of length 4 ( 4 bytes ). I want to
> extract 2nd byte how can i do it in ASE?