jonpryor / dblinq2007

Automatically exported from code.google.com/p/dblinq2007
0 stars 0 forks source link

Wrong query for boolean values in oracle #188

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.generate db in oracle, create a table which contain a ISENABLED column of
type NUMBER(1)
2. generate linqToSql using DbMetal (the field type must be boolean)
3.run the following code:

var context= ...;
context.Log = Console.Out;
var query = (from x in context.Items where !x.ISENABLED).ToArray();

What is the expected output? What do you see instead?
The expected output would be the list of items that are not enabled.
you'll receive an OracleException.

What version of the product are you using? On what operating system?
DbLinq 0.19 on XP

Please provide any additional information below.
the generated query is "SELECT * FROM ITEM WHERE NOT ITEM.ISENABLED" which
is correct in MS SQL but not in Oracle as we do not have real boolean type
in Oracle.
the suggestion is to generate query "SELECT * FROM ITEM WHERE
(ITEM.ISENABLED = 0)

Original issue reported on code.google.com by kamran.fallah@gmail.com on 30 Jan 2010 at 1:07

GoogleCodeExporter commented 9 years ago
Issue 189 has been merged into this issue.

Original comment by jonmpr...@gmail.com on 9 Mar 2010 at 10:27

GoogleCodeExporter commented 9 years ago

Original comment by jonmpr...@gmail.com on 9 Mar 2010 at 10:29

GoogleCodeExporter commented 9 years ago
Hi,
I am using oracle 11g and I am able to generate using dbml but the DBML file is 
empty and in version 10 If I tried to generate getting error as 
DbMetal:Sequence contain more than one matching element. Please help me to 
resolve the issue.

Original comment by mahadevb...@gmail.com on 1 Apr 2014 at 11:28