Page 1 of 1

ORA-01460: unimplemented or unreasonable conversion requested

Posted: Wed 31 Oct 2012 19:24
by slaxman
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)

Re: ORA-01460: unimplemented or unreasonable conversion requested

Posted: Wed 31 Oct 2012 22:32
by ebickle
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.

Re: ORA-01460: unimplemented or unreasonable conversion requested

Posted: Thu 01 Nov 2012 17:59
by Shalex
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).

Re: ORA-01460: unimplemented or unreasonable conversion requested

Posted: Mon 05 Nov 2012 03:59
by kiachao
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;

Re: ORA-01460: unimplemented or unreasonable conversion requested

Posted: Mon 05 Nov 2012 04:06
by kiachao
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

Re: ORA-01460: unimplemented or unreasonable conversion requested

Posted: Fri 09 Nov 2012 12:10
by Shalex
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.

Re: ORA-01460: unimplemented or unreasonable conversion requested

Posted: Fri 09 Nov 2012 14:56
by slaxman
great, thanks

Re: ORA-01460: unimplemented or unreasonable conversion requested

Posted: Thu 15 Nov 2012 14:13
by Shalex
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.