Page 1 of 1

Conditional operators in projection

Posted: Fri 13 Jul 2012 09:38
by Yoke78
Hello,

I'm connecting to an Oracle database using dotConnect for Oracle.
I have an error when using conditional operators in projection such as ?: or ??

Here's a query example (probably not 100% exact):

var query = (from user in context.Users.AsQueryable()
select new user2()
{
name = user.Name,
address = user.Street=="" ? "" : user.Street + user.City
});

Is there a restriction using such operator with the Oracle provider (it works fine using MS standard provider for SQL Server) ?

Thanks,
Yoann

Re: Conditional operators in projection

Posted: Mon 16 Jul 2012 11:20
by MariiaI
Thank you for the report. We have reproduced the issue with Oracle conditional operators and empty strings. We will investigate it and notify you about the results as soon as possible.
As a workaround, you could try rewriting your query in the next way:

Code: Select all

var query = (from user in context.Users.AsQueryable()
select new user2()
{
name = user.Name,
address = user.Street==null ? "": user.Street + user.City
});
Please notify us about the results.

Re: Conditional operators in projection

Posted: Mon 16 Jul 2012 15:44
by Yoke78
Hello,
Thanks for your investigation.

I had problem to see the exact error due to a 3rd party componant.
Now, I have a clear error, which is ORA-12704: character set mismatch.
I fixed the issue changing the columns from nvarchar2 to varchar2.

Yoann

Re: Conditional operators in projection

Posted: Tue 17 Jul 2012 09:40
by MariiaI
Thank you for the additional information. We have reproduced the issue with 'ORA-12704: character set mismatch' error. We will investigate it and notify you about the results.

Re: Conditional operators in projection

Posted: Tue 24 Jul 2012 11:28
by MariiaI
We have fixed the bugs that refer to the Oracle conditional operators and nvarchar datatypes. The fix will be available in the next build of LinqConnect, which we are planning to release in about two weeks.

Re: Conditional operators in projection

Posted: Fri 10 Aug 2012 06:18
by MariiaI
New build of dotConnect for Oracle 7.1.58 is available for download now!
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=1&t=24670