物料新增报错,不能在对象@PKValue_udt2插入重复键
金蝶云社区-CallmeJason
CallmeJason
0人赞赏了该文章 1,758次浏览 未经作者许可,禁止转载编辑于2016年01月28日 16:01:08

物料新增时报“违反了 PRIMARY KEY 约束 'PK__#1306E93__C1BEA5A213FB0D74'。不能在对象 'dbo.@PKValue_udt2' 中插入重复键。
语句已终止”

违反了 PRIMARY KEY 约束 'PK__#1306E93__C1BEA5A213FB0D74'。不能在对象 'dbo.@PKValue_udt2' 中插入重复键。
语句已终止。

[{"operation":"BD_MATERIAL.LoadData"}]
发生时间: 2016-01-28 03:45:45
错误编号: BOS_ExecuteReader
错误信息: 违反了 PRIMARY KEY 约束 'PK__#1306E93__C1BEA5A213FB0D74'。不能在对象 'dbo.@PKValue_udt2' 中插入重复键。
语句已终止。
Sql语句: SELECT T_META_OBJECTTYPE.FID, T_META_OBJECTTYPE.FSUBSYSID FROM T_META_OBJECTTYPE WHERE T_META_OBJECTTYPE.FID IN (SELECT fid FROM @PKValue_udt2);
SELECT T_META_OBJECTTYPE_L.FPkId, T_META_OBJECTTYPE_L.FLocaleId, T_META_OBJECTTYPE_L.FNAME, T_META_OBJECTTYPE_L.FID FROM T_META_OBJECTTYPE_L INNER JOIN T_META_OBJECTTYPE ON T_META_OBJECTTYPE_L.FID = T_META_OBJECTTYPE.FID WHERE T_META_OBJECTTYPE.FID IN (SELECT fid FROM @PKValue_udt2);
===================================================
调用堆栈:

Server stack trace:
at Kingdee.BOS.App.Data.AbstractDatabase.ExecuteReader(DbCommand command, IEnumerable`1 paramList, CommandBehavior cmdBehavior, Boolean bNewCn)
at Kingdee.BOS.App.Data.AbstractDatabase.ExecuteReader(DbCommand command, IEnumerable`1 paramList, CommandBehavior cmdBehavior)
at Kingdee.BOS.App.Data.DBUtils.ExecuteReader(Context ctx, String strSQL, IEnumerable`1 paramList, CommandType cmdtype, CommandBehavior cmdBehavior, Boolean bNewCn)
at Kingdee.BOS.App.Data.DBUtils.ExecuteReader(Context ctx, String strSQL, IEnumerable`1 paramList, CommandType cmdtype, Boolean bNewCn)
at Kingdee.BOS.App.Data.Sql.KSql4SQLDataReader..ctor(IList`1 selectSqls, Context ctx, ReadWhere where, IEnumerable`1 tablesSchema, DbMetadataTable rootTable)
at Kingdee.BOS.App.Data.OLEDbDriver.ExecuteReader(SelectCallback callback, IEnumerable`1 tablesSchema, DbMetadataTable rootTable, IList`1 selectSqls, ReadWhere where, OperateOption option)
at Kingdee.BOS.Orm.Drivers.DbDriverBase.Select(SelectCallback callback, IEnumerable`1 tablesSchema, DbMetadataTable rootTable, ReadWhere where, OperateOption option)
at Kingdee.BOS.Orm.DataManager.DataManagerImplement.Read(ReadWhere where, OperateOption option)
at Kingdee.BOS.Orm.DataManager.DataManagerImplement.AutoBatchExecute(IEnumerable ids, OperateOption option, Func`2 func)
at Kingdee.BOS.Orm.DataManager.DataManagerImplement.Read(IEnumerable ids, OperateOption option)
at Kingdee.BOS.App.Core.CachedLoadReferenceObjectManager.Read(IDataEntityType dt, Object[] oids)
at Kingdee.BOS.Orm.LoadReferenceObjectManager.DoTasks(ICollection`1 tasks, Dictionary`2 dictReferenceWhere)
at Kingdee.BOS.App.Core.BusinessDataReader.Load(Object[] pkArray, DynamicObjectType type, Boolean loadReferenceData)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Kingdee.BOS.Contracts.IViewService.Load(Context ctx, BusinessInfo businessInfo, List`1 selector, OQLFilter ofilter)
at Kingdee.BOS.App.Security.Permission.PermissionDataReader.GetDataRuleFormId(String strObjectTypeId)
at Kingdee.BOS.App.Security.Permission.PermissionDataReader.GetBaseDataDataRuleInfo(Int64 userId, String strObjectTypeId, String strBaseDataObjectTypeID, IEnumerable`1 lngRoles)
at Kingdee.BOS.App.Security.Permission.PermissionDataReader.GetAllDataRule(DataRuleFilterParamenter dataRuleFilterParamenter, Boolean useOrgFilter, String strOrgKey, List`1 authResults, Boolean& bUsebzIsolateOrgIds)
at Kingdee.BOS.App.Security.Permission.PermissionDataReader.LoadDataRuleFilter(DataRuleFilterParamenter dataRuleFilterParamenter)
at Kingdee.BOS.App.Core.Query.QueryBuilder..ctor(Context context, QueryInfo queryInfo, QueryBuilderParemeter para)
at Kingdee.BOS.App.Core.Query.QueryService.GetQueryObject(Context ctx, QueryBuilderParemeter para)
at Kingdee.BOS.App.Core.Query.QueryService.GetDynamicObjectCollection(Context ctx, QueryBuilderParemeter para, List`1 paramList)
at Kingdee.BOS.App.Core.BusinessDataReader.LoadPkValues(DynamicObjectType type, QueryBuilderParemeter queryParemeter)
at Kingdee.BOS.App.Core.BusinessDataReader.LoadFromCache(DynamicObjectType type, QueryBuilderParemeter queryParemeter, Boolean loadReferenceData)

Exception rethrown at [1]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Kingdee.BOS.Contracts.IViewService.LoadFromCache(Context ctx, DynamicObjectType type, QueryBuilderParemeter queryParemeter)
at Kingdee.BOS.ServiceHelper.BusinessDataServiceHelper.LoadFromCache(Context ctx, DynamicObjectType type, QueryBuilderParemeter queryParemeter)
at Kingdee.BOS.Model.DynamicForm.DynamicFormModel.LoadFieldDataWithCoreFilter(BaseDataField field, Object pkValue, DynamicObject activeRow)
at Kingdee.BOS.Core.Metadata.FieldElement.BaseDataField.SetFieldValue(IDynamicFormModel model, DynamicObject activeRow, Object value)
at Kingdee.BOS.Core.DynamicForm.AbstractDynamicFormModel.UpdateFieldValue(Field field, DynamicObject obj, Object value, Int32 row)
at Kingdee.BOS.Core.DynamicForm.AbstractDynamicFormModel.UpdateField(Field field, DynamicObject activeRow, Object value, Int32 rowIndex, Object oldValue)
at Kingdee.BOS.Core.DynamicForm.AbstractDynamicFormModel.SetValue(Field field, DynamicObject activeRow, Object value, Int32 rowIndex)
at Kingdee.BOS.Core.DynamicForm.AbstractDynamicFormModel.SetValue(Field field, Object value, Int32 row)
at Kingdee.BOS.Core.DynamicForm.AbstractDynamicFormModel.SetValue(String key, Object value, Int32 row)
at Kingdee.BOS.Core.DynamicForm.AbstractDefaultValueCalculator.ApplySystemFieldDefaultValue(Entity entity, DynamicObject rowDataEntity, Int32 row)
at Kingdee.BOS.Core.DynamicForm.AbstractDefaultValueCalculator.ApplyDefaultValue(Entity entity, DynamicObject rowDataEntity, Int32 row, String InOpertion)
at Kingdee.BOS.Core.DynamicForm.AbstractDynamicFormModel.CreateNewData(DynamicObject newObject)
at Kingdee.BOS.Model.Bill.BillModel.CreateNewData(DynamicObject newObject)
at Kingdee.BOS.Web.Bill.BillView.CreateNewModelData()
at Kingdee.BOS.Web.Bill.BillView.LoadData()
at Kingdee.BOS.Web.Base.BaseView.LoadData()
at Kingdee.BOS.Web.DynamicForm.DynamicWebFormController.LoadData()