Re: BIT_WISE AND|OR ETC
Posted in 1995
I Wish!
You can extract a lot of information from a single bit using bitwise
operators, the problem is that it is not relational and therefore not
part of SQL.
We have an application written in c that runs totally in
memory. Data is loaded from informix at the start of trading, and
downloaded at the close of day. Because memory is always a finite
resource we store as much information as we can as bit fields.
It would be so nice if we could BIT_AND in SQL when we do end of day
reporting. As it is we use stored procedure to do what an ampersand does.
It is shocking and devours cycles but we are stuck with it; Informix are
not about to compromise the integrity of their engines by letting joe
application programmer link in their home grown functions into SPL.
If anyone out there known any different, or any better, or has a work
around, I would love to hear about it.
Regards, Pete.
On Wed, 21 Jun 1995, Paul Mahoney wrote:
> It is possible to perform bit-wise logic functions in SQL?
>
> The Informix manuals do not mention and logical functions, but we all know
> that Informix has a number of "undocmented" features :-)
>
> Ideally I would like to do the following
>
> select col1, col1, ...
> from table
> where col3 & 6 = 6;>
> That is, select rows where the value in col3 has bits 1 and 2 set.
>
> Seeing as you can add, subtract, multiply, divide and concatenate... I don't
> see why the above should not be permitted.
>
> ---
> Paul Mahoney, X-Act Solutions Limited
> smail: Owlsmead, Meads Road, Little Common, Bexhill-on-Sea, East Sussex TN39 4SY
> email: ptm@xact.demon.co.uk ... pmahoney@cix.compulink.co.uk
>