ORA-01460: unimplemented or unreasonable conversion requested

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
slaxman
Posts: 47
Joined: Wed 16 Sep 2009 20:09
Location: United States

ORA-01460: unimplemented or unreasonable conversion requested

Post by slaxman » Wed 31 Oct 2012 19:24

The exception happens when using Entityframework query with a filter on a NVARCHAR2 field. Sounds like a mapping issue between types NVARCHAR2 and NVARCHAR. I am using verion 7.2.96 with settings Direct=True and Unicode=True

here are the details...

CREATE TABLE "MyTable"(
"Id" raw(16) NOT NULL,
"Name" nvarchar2(255) NOT NULL,
CONSTRAINT "PK_MyTable" PRIMARY KEY ("Id")
)

--EF query snippet in C#
string name = "test";
context.MyTable.Where(c => c.Name == name); // results in ORA-01460 exception
--

exception call stack -

EXCEPTION (Devart.Data.Oracle.OracleException): ORA-01460: unimplemented or unreasonable conversion requested
Stack Trace: at Devart.Data.Oracle.u.d()
at Devart.Data.Oracle.ar.h()
at Devart.Data.Oracle.ar.c()
at Devart.Data.Oracle.aa.a(Int32 A_0, by A_1)
at Devart.Data.Oracle.OracleCommand.InternalExecute(CommandBehavior behavior, IDisposable disposable, Int32 startRecord, Int32 maxRecords, Boolean nonQuery)
at Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior, Boolean nonQuery)
at Devart.Data.Oracle.Entity.v.a(CommandBehavior A_0)
at Devart.Common.Entity.o.b(CommandBehavior A_0)
at Devart.Data.Oracle.Entity.v.b(CommandBehavior A_0)

ebickle
Posts: 2
Joined: Wed 31 Oct 2012 22:27

Re: ORA-01460: unimplemented or unreasonable conversion requested

Post by ebickle » Wed 31 Oct 2012 22:32

I'm having the exact same problem here. Any Entity Framework query that uses string equality on a variable fails. Field is an NVARCHAR2 of length 100.

For example:

Code: Select all

string customerName = "Test";
var results1 = entityContext.Customers.Where(c => c.Name == "Test").ToList(); // WORKS
var results2 = entityContext.Customers.Where(c => c.Name == customerName).ToList(); // FAILS
We're using Direct=True in our case as well. C#, .NET 4.5, Entity Framework 5, using "Code First" with db generation turned off.

Shalex
Devart Team
Posts: 8079
Joined: Thu 14 Aug 2008 12:44

Re: ORA-01460: unimplemented or unreasonable conversion requested

Post by Shalex » Thu 01 Nov 2012 17:59

1. Please turn on the dbMonitor tool and make sure that the data type of the parameter, which is used for comparing with the NVARCHAR2 column, is OracleDbType.NVarChar.
2. There is a known bug with the NVarChar parameters in the Direct mode. We are woking on the problem and post here when the issue is fixed. As a temporary workaround, please switch to the OCI mode (via Oracle client).

kiachao
Posts: 3
Joined: Wed 31 Oct 2012 03:55
Contact:

Re: ORA-01460: unimplemented or unreasonable conversion requested

Post by kiachao » Mon 05 Nov 2012 03:59

I have error same:
//OK
var user = from t in db.DMSUSERV2S
where t.ACCOUNT == txtUserName.Text
select t;
but this is error:
//Error
var user = from t in db.DMSUSERV2S
where t.ACCOUNT == txtUserName.Text && t.PASS == EncDec.Encrypt(txtPass.Text)
select t;

kiachao
Posts: 3
Joined: Wed 31 Oct 2012 03:55
Contact:

Re: ORA-01460: unimplemented or unreasonable conversion requested

Post by kiachao » Mon 05 Nov 2012 04:06

kiachao wrote:I have error same:
//OK
var user = from t in db.DMSUSERV2S
where t.ACCOUNT == txtUserName.Text
select t;
but this is error:
//Error
var user = from t in db.DMSUSERV2S
where t.ACCOUNT == txtUserName.Text && t.PASS == EncDec.Encrypt(txtPass.Text)
select t;

I temporary fix this error by:
var user = from t in db.DMSUSERV2S
where t.ACCOUNT == txtUserName.Text
select t;
if (user.count()>0)
user.select(t => t.pass = Encrypt(txtPass.Text))

hehe, hope devart fix this problem soon by official

Shalex
Devart Team
Posts: 8079
Joined: Thu 14 Aug 2008 12:44

Re: ORA-01460: unimplemented or unreasonable conversion requested

Post by Shalex » Fri 09 Nov 2012 12:10

The bug with the NVARCHAR parameters in the Direct mode is fixed. We will post here when the corresponding build of dotConnect for Oracle is available for download.

slaxman
Posts: 47
Joined: Wed 16 Sep 2009 20:09
Location: United States

Re: ORA-01460: unimplemented or unreasonable conversion requested

Post by slaxman » Fri 09 Nov 2012 14:56

great, thanks

Shalex
Devart Team
Posts: 8079
Joined: Thu 14 Aug 2008 12:44

Re: ORA-01460: unimplemented or unreasonable conversion requested

Post by Shalex » Thu 15 Nov 2012 14:13

New build of dotConnect for Oracle 7.2.122 is available for download!
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=25287.

Post Reply