binary expression in SQL
Posted in 2001
Topics: General Discussion
Hi all, I do have the following problem. I am using an integer within a table to store bitcoded status information. This is a very efficient way (I think). But SQL only supports bool operators and mathematical functions to retrieve and search for matching columns. Is there any known way to search an entry that matches a binary mask? Currently I am retrieving all columns with a scroll cursor and doing the binary or-check within my C-code. It would be much nicier if there was a way to only get rows where the search key matches the binary searchword. Any help is higly appreciated
In the year of Our Lord Sun, 28 Jan 2001 14:10:31 +0100, root <akoppel@akso.de> spake, saying: >I do have the following problem. I am using an integer within a table to >store bitcoded status information. This is a very efficient way (I think). >But SQL only supports bool operators and mathematical functions to retrieve >and search for matching columns. Is there any known way to search an entry >that matches a binary mask? Currently I am retrieving all columns with a >scroll cursor and doing the binary or-check within my C-code. It would be >much nicier if there was a way to only get rows where the search key >matches the binary searchword. If you really want efficiency in storing your data, why not use C-ISAM? Plus, you get to use all the bitwise arithmetic you want! (This is my way of asking you why you're using a database) If you're using 9.x you can add what ever functions you want.