This is a migrated thread and some comments may be shown as answers.

checking NULL value in where clause fails with new version of ORM

1 Answer 94 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
FISCAL
Top achievements
Rank 1
FISCAL asked on 04 Jul 2011, 09:43 AM
Hi,

With the latest version of Open Access [2011.1.411.2], following LINQ query fails which was working fine with the older version

LINQ query:

 int transactionCount = (from process in m_dataContext.DPFInvoiceData
                                    //where process.Processed == null || process.Processed == false //NULL condition is failing in this new version
                                    select process.DPFInvoiceDataID).ToList().Count();

Stack Trace:

Error executing query: Telerik.OpenAccess.RT.sql.SQLException: An expression of non-boolean type specified in a context where a condition is expected, near 'THEN'. at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery() at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery() at OpenAccessRuntime.Relational.fetch.FetchResultImp.Execute() SQL: SELECT a.[DPFInvoiceDataID] AS COL1 FROM [DPFInvoiceData] a WHERE (CASE WHEN a.[Processed] <> 0 THEN 1 ELSE 0 END) = (CASE WHEN NULL THEN 1 ELSE 0 END) OR (CASE WHEN a.[Processed] <> 0 THEN 1 ELSE 0 END) = 0 Telerik.OpenAccess.RT.sql.SQLException: An expression of non-boolean type specified in a context where a condition is expected, near 'THEN'. at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery() at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery() at OpenAccessRuntime.Relational.fetch.FetchResultImp.Execute()


Could you please let me know how to resolve it?

Many thanks.

MG

1 Answer, 1 is accepted

Sort by
0
Thomas
Telerik team
answered on 08 Jul 2011, 01:48 PM
Hello Milan,

sorry for the inconvenience, we already fixed the issue. The upcoming 2011Q2 release will have the needed bits for that. 

All the best,
Thomas
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Development (API, general questions)
Asked by
FISCAL
Top achievements
Rank 1
Answers by
Thomas
Telerik team
Share this question
or