I'm using:
- Devart dotConnect for DB2 Pro v1.8.622 (22-Oct-15)
- .NET 4.5
- EF 6.1.3
- DB2 9.7
Silvio C
1) the text, in portuguese: [IBM][DB2/NT64] SQL0440N No function by the name "TOUPPER" of type "FUNCTION" having compatible arguments.Shalex wrote:We still cannot reproduce the described issue. Please specify the additional information:
1) the exact text of the error and its call stack
2) the generated SQL (turn on dbMonitor)
Code: Select all
System.Data.Entity.Infrastructure.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.Data.Entity.Core.UpdateException: An error occurred while updating the entries. See the inner exception for details. ---> Devart.Data.DB2.DB2Exception: ERROR [42884] [IBM][DB2/NT64] SQL0440N No function by the name "TOUPPER" of type "FUNCTION" having compatible arguments.
em Devart.Data.DB2.c.i()
em Devart.Data.DB2.DB2Command.a(CommandBehavior A_0, IDisposable A_1, Int32 A_2, Int32 A_3)
em Devart.Data.DB2.DB2Command.ExecuteNonQuery()
em Devart.Common.Entity.dg.ExecuteNonQuery()
em Devart.Data.DB2.Entity.v.f()
em System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.<NonQuery>b__0(DbCommand t, DbCommandInterceptionContext`1 c)
em System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
em System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.NonQuery(DbCommand command, DbCommandInterceptionContext interceptionContext)
em System.Data.Entity.Internal.InterceptableDbCommand.ExecuteNonQuery()
em System.Data.Entity.Core.Mapping.Update.Internal.DynamicUpdateCommand.Execute(Dictionary`2 identifierValues, List`1 generatedValues)
em System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update()
--- Fim do rastreamento de pilha de exceções internas ---
em System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update()
em System.Data.Entity.Core.EntityClient.Internal.EntityAdapter.<Update>b__2(UpdateTranslator ut)
em System.Data.Entity.Core.EntityClient.Internal.EntityAdapter.Update[T](T noChangesResult, Func`2 updateFunction)
em System.Data.Entity.Core.EntityClient.Internal.EntityAdapter.Update()
em System.Data.Entity.Core.Objects.ObjectContext.<SaveChangesToStore>b__35()
em System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
em System.Data.Entity.Core.Objects.ObjectContext.SaveChangesToStore(SaveOptions options, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction)
em System.Data.Entity.Core.Objects.ObjectContext.<>c__DisplayClass2a.<SaveChangesInternal>b__27()
em System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute[TResult](Func`1 operation)
em System.Data.Entity.Core.Objects.ObjectContext.SaveChangesInternal(SaveOptions options, Boolean executeInExistingTransaction)
em System.Data.Entity.Core.Objects.ObjectContext.SaveChanges(SaveOptions options)
em System.Data.Entity.Internal.InternalContext.SaveChanges()
--- Fim do rastreamento de pilha de exceções internas ---
em System.Data.Entity.Internal.InternalContext.SaveChanges()
em System.Data.Entity.Internal.LazyInternalContext.SaveChanges()
em System.Data.Entity.DbContext.SaveChanges()
em Abp.EntityFramework.AbpDbContext.SaveChanges()
em Brain.CRM.RapidWebDev.EntityFramework.BrainDbContext.SaveChanges()
em Brain.CRM.RapidWebDev.EntityFramework.BrainDbContext.<>c__DisplayClass9.<funcGetNewCode>b__7()
Code: Select all
db.Set<ATDIC01080>().FirstOrDefault(x => x.NA_SEQN == tableName) => SELECT
"Extent1".NA_SEQN,
"Extent1".CO_SITU,
"Extent1".DT_INSR,
"Extent1".CO_USER_INSR,
"Extent1".DT_LAST_UPDT,
"Extent1".CO_USER_LAST_UPDT,
"Extent1".ID_INFO_SYST,
"Extent1".NU_INCR_BYNU,
"Extent1".NU_LAST_NUMB
FROM DB2ADMIN.ATDIC01080 "Extent1"
WHERE (UPPER("Extent1".NA_SEQN)) = (UPPER('MSPRO98022'))
FETCH FIRST 1 ROWS ONLY
Code: Select all
var seqn = Convert.ToInt32(atdic01080.NU_LAST_NUMB + atdic01080.NU_INCR_BYNU);
atdic01080.NU_LAST_NUMB = seqn;
atdic01080.DT_LAST_UPDT = DateTime.Now;
db.SaveChanges(); => UPDATE DB2ADMIN.ATDIC01080
SET DT_LAST_UPDT = TIMESTAMP('2015-11-12 16:42:52'), NU_LAST_NUMB = 1691147
WHERE (ToUpper(NA_SEQN)) = (ToUpper('MSPRO98022'))
Code: Select all
CreateTable(
"DB2ADMIN.ATDIC01080",
c => new
{
NA_SEQN = c.String(nullable: false, maxLength: 15, unicode: false),
CO_SITU = c.String(nullable: false, maxLength: 5, unicode: false),
DT_INSR = c.DateTime(nullable: false),
CO_USER_INSR = c.String(nullable: false, maxLength: 20, unicode: false),
DT_LAST_UPDT = c.DateTime(nullable: false),
CO_USER_LAST_UPDT = c.String(nullable: false, maxLength: 20, unicode: false),
ID_INFO_SYST = c.String(nullable: false, maxLength: 1, fixedLength: true, unicode: false),
NU_INCR_BYNU = c.Decimal(nullable: false, precision: 18, scale: 2),
NU_LAST_NUMB = c.Decimal(nullable: false, precision: 18, scale: 2),
})
.PrimaryKey(t => t.NA_SEQN);