You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi i am using EntityFramework.Functions to call my stored functions on a MariaDb database server.
Where i get the following error when i am calling my function:
System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details. ---> MySql.Data.MySqlClient.MySqlException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '[next_pdomatid](1)' at line 1
at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId)
at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.EntityFramework.EFMySqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
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)
at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand command, DbCommandInterceptionContext interceptionContext)
at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
--- End of inner exception stack trace ---
at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
at System.Data.Entity.Core.Objects.ObjectContext.CreateFunctionObjectResult[TElement](EntityCommand entityCommand, ReadOnlyCollection`1 entitySets, EdmType[] edmTypes, ExecutionOptions executionOptions)
at System.Data.Entity.Core.Objects.ObjectContext.<>c__DisplayClass47`1.<ExecuteFunction>b__46()
at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
at System.Data.Entity.Core.Objects.ObjectContext.<>c__DisplayClass47`1.<ExecuteFunction>b__45()
at System.Data.Entity.Core.Objects.ObjectContext.ExecuteFunction[TElement](String functionName, ExecutionOptions executionOptions, ObjectParameter[] parameters)
at Pai.CCL.EF.DAL.CCLDbContext.NextPdoMatId(Int32 count) in D:\Tatmetal\CCL\Source\Pai.CCL\Pai.CCL.EF\DAL\CCLDbContext.cs:line 64
at Pai.CCL.Services.CCLService.GetNewMaterialId() in D:\Tatmetal\CCL\Source\Pai.CCL\Pai.CCL\Services\CCLService.cs:line 129
The definition looks like following;
[Function(FunctionType.NonComposableScalarValuedFunction, "next_pdomatid", Schema = "")]
[return: Parameter(DbType = "int")]
public int NextPdoMatId([Parameter(DbType = "int")]int count)
{
var countParameter = new ObjectParameter("count", count);
return this.ObjectContext()
.ExecuteFunction<int>("next_pdomatid",
countParameter).SingleOrDefault();
}
When i run the function with HeidiSQL the query looks like this:
SELECT next_pdomatid('1')
and a query with the [], there i get the same error.
Is there any chance to set it up to not to use the []?
The text was updated successfully, but these errors were encountered:
Streissi
changed the title
SqlSyntaxError for MySQL Database with non composable scalar valued function
SqlSyntaxError for MariaDB Database with non composable scalar valued function
Jun 26, 2019
Hi i am using EntityFramework.Functions to call my stored functions on a MariaDb database server.
Where i get the following error when i am calling my function:
The definition looks like following;
When i run the function with HeidiSQL the query looks like this:
and a query with the
[]
, there i get the same error.Is there any chance to set it up to not to use the
[]
?The text was updated successfully, but these errors were encountered: