0

After I updated my project to Version 7.2.114 of DevArt I recognized that some queries will not return results although the generated SQL is returning results if executed directly in TOAD. If I switch back to Version 7.0.25 everything works fine.

My database Customer-table looks like this:

SomeField  | Firstname  | CustomerNo

(null)     | John       | 12345
12345      | John       | 12345
828282     | Mark       | 12346

My query looks like this:

var firstNameToSearch = "John";
var someFieldToSearch = null;
var result = from customer in context.Customers
            join someTable in context.SomeTables on customer.CustomerNo equals "12345"                            
            where someTable.SomeCondition && (someTable.SomeField == someFieldToSearch || someFieldToSearch == null) && (customer.Firstname == firstNameToSearch || firstNameToSearch == null) 

Now, when I execute the EF-query it will result in 0 records with no exception at all. But if I take the SQL-command it will result in 2 records.

If I change code in Line 2 to:

var someFieldToSearch = string.Empty;

it will return the right result.

I found an some hints pointing to this code:

Devart.Data.Oracle.Entity.OracleEntityProviderServices.HandleNullStringsAsEmptyStrings = true;

but it has no effects.

Alexander Schmidt
  • 5,631
  • 4
  • 39
  • 79

1 Answers1

1

Please try the latest (7.2.122) version of dotConnect for Oracle. If this doesn't help, specify the following information: 1) turn on the dbMonitor tool and post here (or at forums.devart.com/viewforum.php?f=30 ) the generated SQL, used parameters (their types and values); 2) the exact data types of involved database columns; 3) are you using the OCI (via Oracle client) or Direct connection mode?

Devart
  • 119,203
  • 23
  • 166
  • 186
  • Thanks for the hints. We are using direct mode in that case. I didn't post the SQL because the original query is much more complex but I'll try. First I'll check the newest version. Is there an update regarding our issue included? – Alexander Schmidt Nov 17 '12 at 11:00