Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > Bugs & Issues> Bitwise operators for Oracle
 

Pages: 1
Bugs & Issues
Bitwise operators for Oracle
Page:1/1 

  Print all messages in this thread  
Poster Message
ww
User



Location:

Joined on:
01-Oct-2004 22:58:25
Posted:
72 posts
# Posted on: 14-Jun-2020 19:42:43.  
I'm using version 4.1 for this project.

The RTF documentation for all version I've seen says that "BitwiseOr, BitwiseAnd and BitwiseXor. The bitwise operations are for SqlServer or PostgreSql only." But I saw a forum post indicating that they're supported for Oracle as of v3.

When I use ExOp.BitwiseAnd for an Oracle project, the generated query uses SQL Server syntax :

Code:

where (x&y)=z


instead of Oracle syntax:

Code:

where bitand(x&y)=z


I haven't tested in a later version but don't see anything about this in any release notes.

So, if bitwise operators are supposed to be supported for Oracle, they don't appear to be working.
  Top
daelmo
Support Team



Location:
Guatemala City
Joined on:
28-Nov-2005 23:35:24
Posted:
8137 posts
# Posted on: 15-Jun-2020 07:32:08.  
ww wrote:
The RTF documentation for all version I've seen says that "BitwiseOr, BitwiseAnd and BitwiseXor. The bitwise operations are for SqlServer or PostgreSql only." But I saw a forum post indicating that they're supported for Oracle as of v3.

Hi ww. Yes, that's what is stated in the documentation and that's what is supported. BITAND(n1,n2) and other oracle's bitwise functions are considered functions not operators.

The thread you are referring to (I think is this) is a very old thread (2005) referring to a 3rd party contribution about a Bitwise predicate when the LLBLGen Framework didn't support Bitwise operators. Anyway the framework supports Bitwise operators, the BIT??? functions are functions.

To be able to use BITAND and others in your fields or predicates, you should use a function call (ref...).

I hope that helps Regular Smiley


David Elizondo
LLBLGen'ing (articles and code snippets) | linkedin | twitter
 
Top
ww
User



Location:

Joined on:
01-Oct-2004 22:58:25
Posted:
72 posts
# Posted on: 16-Jun-2020 15:02:08.  
That is the forum thread I was referring to. I wasn't thinking about the distinction between operator and function so I was expecting that when I used the ExOp filter LLBLGEN would construct a query using BITAND. Instead it creates the query using the (unsupported) "&" operator, and the query fails with Oracle error ORA-00920: invalid relational operator.

Thanks for the pointer to calling functions instead--I hadn't thought of that somehow. (Your link to an example of BITAND doesn't go anywhere but the reference guide is enough.)
  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
38047 posts
# Posted on: 17-Jun-2020 08:56:52.  
The Bitand link was to a thread in 'helpdesk', hence it didn't go anywhere. the example for completeness:

Code:
IExpression myExp = new DbFunctionCall( "bitand", new object[] { AddressTypeFields.IdModuleType, 2} );
IEntityField myField = MyEntityFields.Field1.SetExpression(myExp);
PredicateExpression myFilter = new PredicateExpression(myField > 0)


The "&" Operator doesn't have a function mapping in the DQE, however your description shows it should have. We'll look into adding that in a future version.


Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
ww
User



Location:

Joined on:
01-Oct-2004 22:58:25
Posted:
72 posts
# Posted on: 17-Jun-2020 15:22:08.  
Thank you.
  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.