Robert Valentino Well-Known Member Licensed User Longtime User Nov 13, 2016 #1 I need to do a 64 bit And ( & ) request in a SQLStatement If C++ I use to do something like this Code: Copy "SELECT ID, Primary, Secondary Special FROM Songs WHERE ((Category & '%I64d') and (Secondary & '%I64d') and ((Special & '%I64d') == 0))" How do I do a 64bit AND in a SQLite statement in B4A Thanks BobVal
I need to do a 64 bit And ( & ) request in a SQLStatement If C++ I use to do something like this Code: Copy "SELECT ID, Primary, Secondary Special FROM Songs WHERE ((Category & '%I64d') and (Secondary & '%I64d') and ((Special & '%I64d') == 0))" How do I do a 64bit AND in a SQLite statement in B4A Thanks BobVal
KMatle Expert Licensed User Longtime User Nov 14, 2016 #2 Robert Valentino said: 64bit AND in a SQLite Click to expand... Normally you don't do a bit and/or operation in a modern database What are you trying to do? Upvote 0
Robert Valentino said: 64bit AND in a SQLite Click to expand... Normally you don't do a bit and/or operation in a modern database What are you trying to do?
Robert Valentino Well-Known Member Licensed User Longtime User Nov 15, 2016 #3 I have 64bit data fields that I want to select Look at it this way. Blue = 0x01 Red = 0x02 Green= 0x04 Pink =0x08 Take this out -- another 30 bits or more for 60 colors (NOTE just using colors as an example) Now I ask you what you desire. You pick your options and I "OR" them together and do a "select xxx where (Colors & YourChoices) " AND-ing one INTEGER to another will produce a list of matches without a lot of compare Upvote 0
I have 64bit data fields that I want to select Look at it this way. Blue = 0x01 Red = 0x02 Green= 0x04 Pink =0x08 Take this out -- another 30 bits or more for 60 colors (NOTE just using colors as an example) Now I ask you what you desire. You pick your options and I "OR" them together and do a "select xxx where (Colors & YourChoices) " AND-ing one INTEGER to another will produce a list of matches without a lot of compare
Erel B4X founder Staff member Licensed User Longtime User Nov 15, 2016 #4 SQLite supports & (and) and | (or): https://www.sqlite.org/lang_expr.html Did you get any error? Upvote 0
Robert Valentino Well-Known Member Licensed User Longtime User Nov 15, 2016 #5 No, I didn't. Just about to start converting a lot of lines of code and wanted to get it right the first time. I know B4A needs to have special routines for & (and) and | (or) when using longs. Didn't know if SQLite would have a problem. All this code works in windows, was hoping it would be an easy port. Thanks for the clarification BobVal Upvote 0
No, I didn't. Just about to start converting a lot of lines of code and wanted to get it right the first time. I know B4A needs to have special routines for & (and) and | (or) when using longs. Didn't know if SQLite would have a problem. All this code works in windows, was hoping it would be an easy port. Thanks for the clarification BobVal
Erel B4X founder Staff member Licensed User Longtime User Nov 16, 2016 #6 The SQL commands are passed as is to the SQLite engine. Upvote 0