on 2015 Dec 04 7:40 AM
hi. I believe I have found a bug in iAnywhere17.
I have some simple code
from a in db.ActiveLoginKeys
where a.lok_key.Contains(key)
select a
This worked fine under iAnywhere12 and EF5 but now I've upgraded to 17 and ef6 I get this error whenever I do a .contains linq command
"internalexception": { "message": **"Cannot convert '%' to a numeric",** "type": "Sap.Data.SQLAnywhere.SAException", "stacktrace": " at Sap.Data.SQLAnywhere.SACommand._ExecuteReader(CommandBehavior commandBehavior, Boolean isExecuteScalar, Boolean isBeginExecuteReader)\\r\\n at Sap.Data.SQLAnywhere.SACommand.ExecuteDbDataReader(CommandBehavior behavior)\\r\\n at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)\\r\\n at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.<reader>b__c(DbCommand t, DbCommandInterceptionContext`1 c)\\r\\n at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)\\r\\n at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand command, DbCommandInterceptionContext interceptionContext)\\r\\n at System.Data.Entity.Internal.InterceptableDbCommand.ExecuteDbDataReader(CommandBehavior behavior)\\r\\n at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)\\r\\n at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)"
if I replace my code with
from a in db.ActiveLoginKeys
where a.lok_key == key
select a
this works fine
Request clarification before answering.
The setup steps for EF6 suppport are a little different than before.
For one thing there is an extra /v EF6 required that wasn't before.
If that isn't the issue you might want to verify the SQL as it arrives at the server.
Adding the -zr SQL+HOSTVARS
switch to the server cmdline you should be able to determine what is causing the parser error. Please share what you find out.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah without the EF6 switch I cannot run any queries against the DB. I set it up with the /v ef6 switch after days of searching.
This is an entirely different problem. Where using
a == "SomeValuw" in linq statements work fine but
.contains("somevalue") does not.
it's as if the SQL being generated is incorrect.
interestingly .contains("somevalue".ToString())
will work but that is not ideal and is not workable when using an OData Dataservice.
Anything helpful from your request logging ?
Hmm. found my problem. I'm trying to use the new ef6 drivers (which are great by the way) with an older legacy versioned DB of sybase.
is there any way I can get the SQL to generate correctly for these older db's?
User | Count |
---|---|
82 | |
29 | |
9 | |
8 | |
7 | |
7 | |
7 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.