"Lena" <lena (AT) tippcom (DOT) co.il> wrote
Quote:
hi all,
where can i read about using a set of boolean options as a bitmap?
any explanations are more than appreciated. |
It's pretty simple -- just use an int column or variable (or smallint or
tinyint), and code like this:
select @v = @v | 1 -- sets bit 0
select @v = @v | 2 -- sets bit 1
if @v & 1 = 0 ... -- bit 0 is not set
if @v & 1 = 1 ... -- bit 0 is set
(etc.)
HTH,
Rob
-------------------------------------------------------------
Rob Verschoor
Certified Sybase Professional DBA for ASE 12.5/12.0/11.5/11.0
and Replication Server 12.5
Author of various Sybase books. New book (coming soon): "The
Complete Sybase Replication Server Quick Reference Guide"
Online orders accepted at http://www.sypron.nl/shop
mailto:rob (AT) YOUR (DOT) SPAM.sypron.nl.NOT.FOR.ME
http://www.sypron.nl
Sypron B.V., P.O.Box 10695, 2501HR Den Haag, The Netherlands
-------------------------------------------------------------