Re: sql question

From: Ranga Chakravarthi <ranga_at_removethis.cfl.rr.com>
Date: Sun, 14 Jul 2002 19:54:51 GMT
Message-ID: <fGkY8.33873$DS.829174_at_twister.tampabay.rr.com>


Chris,

Use the function BITAND
e.g,

SELECT <columns>
FROM <table>
WHERE BITAND(<column_name>, 64) = 64

This will give you all the deletes
HTH "Chris Aiello" <caiell02_at_comcast.net> wrote in message news:LM1Y8.126992$Im2.6119709_at_bin2.nnrp.aus1.giganews.com...
> hi all:
>
> I'm trying to figure out SQL to do the following:
> I have an application that tracks SQL that is being sent to the database,
> and one of it's features is the ability to identify whether a query is an
> insert, update, delete, select, select with all rows returned, the query
 is
> the first in a user session....and many other criteria. Because of the
> nature of SQL, i.e. many of the above could be true, the deisgners made
 each
> flag a 'bit'. So an example is:
> 4 is a select
> 8 is insert
> 16 is update
> 32 is first query in session
> 64 is delete
> 128 is a cancelled query
> 256 is database cancelled query
>
>
>
> Now the SQL that I have to find is 'which of these records is a delete?'
> The values could be 64, 96, 416, 445, 320 and many others. All in all
> there are probably 20 possible values and the permutations are to lengthy
 to
> put in a 'like', so I need some kind of algorithm. Does anyone have any
> ideas?
>
> email:
> caiell02_at_comcast.net
>
> thanks, Chris
>
>
>
Received on Sun Jul 14 2002 - 21:54:51 CEST

Original text of this message