Conditional operators in projection

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
Yoke78
Posts: 4
Joined: Fri 13 Jul 2012 09:27

Conditional operators in projection

Post by Yoke78 » Fri 13 Jul 2012 09:38

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

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Conditional operators in projection

Post by MariiaI » Mon 16 Jul 2012 11:20

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.

Yoke78
Posts: 4
Joined: Fri 13 Jul 2012 09:27

Re: Conditional operators in projection

Post by Yoke78 » Mon 16 Jul 2012 15:44

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

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Conditional operators in projection

Post by MariiaI » Tue 17 Jul 2012 09:40

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.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Conditional operators in projection

Post by MariiaI » Tue 24 Jul 2012 11:28

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.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Conditional operators in projection

Post by MariiaI » Fri 10 Aug 2012 06:18

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

Post Reply