InvalidOperationException when using IQ driver with Oracle Connection
I'm not sure what the root cause for the issue may be. I have a table in Oracle that I'm trying to query using LINQPad with the IQ driver.
When I run a simple take command (Ah.Take(100)), it throws an error:
InvalidOperationException: The binary operator Equal is not defined for the types 'System.Int64' and 'System.Decimal'.
I went through all the columns that were Int64 and Decimal in the table and was able to select them individually.
I tried troubleshooting to narrow down the issue and so I scripted out a select new { all columns}, thinking that this would fail and I would comment out columns until I found the problem. The query runs without issue, however.
I'm not sure what causes the query to fail when requesting the record, but succeed when requesting a new object with every column on that record.
Is this a bug, or am I not using this the right way? Details are below:
LINQPad 5 (Free Edition) v5.31.00(AnyCPU)
IQ (Supports Oracle, MySQL, SQLite) v 2.1.4.0
The connection mode is OCI. I can connect using SQLTools (an oracle client) without issue.
When I run a simple take command (Ah.Take(100)), it throws an error:
InvalidOperationException: The binary operator Equal is not defined for the types 'System.Int64' and 'System.Decimal'.
I went through all the columns that were Int64 and Decimal in the table and was able to select them individually.
I tried troubleshooting to narrow down the issue and so I scripted out a select new { all columns}, thinking that this would fail and I would comment out columns until I found the problem. The query runs without issue, however.
I'm not sure what causes the query to fail when requesting the record, but succeed when requesting a new object with every column on that record.
Is this a bug, or am I not using this the right way? Details are below:
LINQPad 5 (Free Edition) v5.31.00(AnyCPU)
IQ (Supports Oracle, MySQL, SQLite) v 2.1.4.0
The connection mode is OCI. I can connect using SQLTools (an oracle client) without issue.
Comments
Unfortunately, whoever designed the database didn't think about ensuring the foreign keys' datatypes matched their primary keys. In this case, it is a decimal (number(38,0)) vs. an integer (number(22,0)).
Is there any way to get this to work through LINQPad? Maybe turn off the associations or use a custom comparer? If not, it's all good, I'll just have to alias and bring back only the columns I want.
Maybe it is possible to define a custom comparer in "My Extensions" or something like that? I tried it, but wasn't successful so far...