起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 182|回复: 3

【搞定】[请求]中建:主数据集保存时出错

[复制链接]
发表于 2007-9-12 11:40:02 | 显示全部楼层 |阅读模式
错误栈:
错误类型:EOleException
错误信息:执行更新数据的时候出现错误:ORA-00001: 违反唯一约束条件 (BUSINESS.SYS_C0047518)
连接参数:数据库URL:Biz:\ZJYJ\CWSJK.Database
SQL语句:SELECT *
  FROM TBL_WZHTCKJLZB
  WHERE TBL_WZHTCKJLZB.GUID IS NULL
错误描述:

环境栈:
错误类型:EOleException
无环境信息

调用栈:

主数据集
object DataSetCKJLZSJJ: TSQLDataSet
  Relation.DeleteRule = krNoAction
  Relation.UpdateRule = krNoAction
  ID = 'CKJLZSJJ'
  DisplayName = #20986#24211#35760#24405#20027#25968#25454#38598
  Database.Reference = '@Biz:\ZJYJ\CWSJK.Database'
  CheckConstraints = <>
  Params = <>
  SQL.Text =
    'SELECT *'#13#10'  FROM TBL_WZHTCKJLZB'#13#10'  WHERE TBL_WZHTCKJLZB.GUID IS ' +
    'NULL '
  Left = 146
  Top = 106
  object FIELD_CKJLZSJJ_XMBM: TUserDataField
    ID = 'XMBM'
    DisplayName = #39033#30446#32534#30721
    DataType = dtString
    DataTypeAttribute.Size = 128
    EditStyleID = 'String'
    AutoFillDef.Trigger = [ftOnInsert, ftOnEdit, ftOnDataChange]
    LookupDef.Kind = lkDataValues
    LookupDef.DataBase.Reference = '@Biz:\ZJYJ\CWSJK.Database'
    LookupDef.SQL.Strings = (
      'SELECT TBL_XMXXB.GUID, TBL_JCXXB.MC'
      '  FROM TBL_XMXXB, TBL_JCXXB'
      '  WHERE TBL_JCXXB.GUID = TBL_XMXXB.GUID')
    LookupDef.DisplayField = 'MC'
    LookupDef.KeyField = 'GUID'
    LookupDef.Options = [loAutoRefresh]
    StoredProps = {
      417474726962757465730D0A4175746F46696C6C4465660D0A456C656D656E74
      0D0A4C6F6F6B75704465660D0A}
  end
  object FIELD_CKJLZSJJ_LLDW: TUserDataField
    ID = 'LLDW'
    DisplayName = #39046#26009#21333#20301
    DataType = dtString
    DataTypeAttribute.Size = 64
    EditStyleID = 'String'
    AutoFillDef.Trigger = [ftOnInsert, ftOnEdit, ftOnDataChange]
    LookupDef.Kind = lkDataValues
    LookupDef.DataBase.Reference = '@Biz:\ZJYJ\CWSJK.Database'
    LookupDef.SQL.Strings = (
      'SELECT TBL_FBHTB.FBBM, TBL_JCXXB.MC'
      '  FROM TBL_FBHTB, TBL_JCXXB'
      
        '  WHERE TBL_FBHTB.XMBM = &[Biz:\SYSTEM\ORGPARAMS.PARAMGROUP\Dept' +
        'ID.Param] and TBL_FBHTB.FBBM = TBL_JCXXB.GUID and TBL_FBHTB.LZZD' +
        ' = '#39'-1'#39)
    LookupDef.DisplayField = 'MC'
    LookupDef.KeyField = 'FBBM'
    LookupDef.ViewID = 'GridView'
    LookupDef.ViewProperties.Strings = (
      'object TGridViewDesigner'
      '  RowCount = 15'
      '  VisibleColumns.Strings = ('
      '    '#39'MC'#39')'
      '  Options = []'
      'end')
    LookupDef.Options = [loAutoRefresh, loDropDownButton, loDropDownList]
    StoredProps = {
      417474726962757465730D0A4175746F46696C6C4465660D0A456C656D656E74
      0D0A4C6F6F6B75704465660D0A}
  end
  object FIELD_CKJLZSJJ_CKDHJ: TInternalDataField
    ID = 'CKDHJ'
    DisplayName = #20986#24211#21333#21512#35745
    DataType = dtNumber
    DataTypeAttribute.Precision = 19
    DataTypeAttribute.Scale = 2
    EditStyleID = 'Number'
    Alignment = taRightJustify
    AutoFillDef.Trigger = [ftOnInsert, ftOnEdit, ftOnDataChange]
  end
end



从数据集
object DataSetCKJLCSJJ: TSQLDataSet
  Relation.KeyFieldNames = 'ParentGUID'
  Relation.Master = DataSetCKJLZSJJ
  Relation.MasterFieldNames = 'GUID'
  Relation.DeleteRule = krCascade
  Relation.UpdateRule = krCascade
  ID = 'CKJLCSJJ'
  DisplayName = #20986#24211#35760#24405#20174#25968#25454#38598
  Database.Reference = '@Biz:\ZJYJ\CWSJK.Database'
  CheckConstraints = <>
  Params = <>
  SQL.Text = 'SELECT *'#13#10'  FROM TBL_WZHTCKJLCB'
  Left = 146
  Top = 106
  object FIELD_CKJLCSJJ_SLDH: TUserDataField
    ID = 'SLDH'
    DisplayName = #25910#26009#21333#21495
    DataType = dtString
    DataTypeAttribute.Size = 32
    EditStyleID = 'String'
    AutoFillDef.Trigger = [ftOnInsert, ftOnEdit, ftOnDataChange]
    LookupDef.Kind = lkDataValues
    LookupDef.DataBase.Reference = '@Biz:\ZJYJ\CWSJK.Database'
    LookupDef.SQL.Strings = (
      
        'SELECT TBL_WZJCJLZB.CLMC, TBL_WZJCJLZB.GG, TBL_WZJCJLZB.DW, TBL_' +
        'WZJCJLZB.ZBDJ, TBL_WZXXB.CLYJFL, TBL_JCXXB.MC, TBL_WZJCJLZB.SLDH'
      '  FROM TBL_WZJCJLZB, TBL_WZXXB, TBL_JCXXB'
      
        '  WHERE TBL_WZJCJLZB.CLMC = TBL_WZXXB.GUID and TBL_WZJCJLZB.CLMC' +
        ' = TBL_JCXXB.GUID')
    LookupDef.DisplayField = 'SLDH'
    LookupDef.KeyField = 'SLDH'
    LookupDef.Options = [loAutoRefresh, loNoDropDown]
    StoredProps = {
      417474726962757465730D0A4175746F46696C6C4465660D0A456C656D656E74
      0D0A4C6F6F6B75704465660D0A}
  end
  object FIELD_CKJLCSJJ_WZLB: TLookupCalcField
    ID = 'WZLB'
    DisplayName = #29289#36164#31867#21035
    DataType = dtString
    DataTypeAttribute.Size = 32
    EditStyleID = 'String'
    Alignment = taLeftJustify
    KeyField = 'SLDH'
    ResultField = 'CLYJFL'
    UseKeyFieldLookupDef = True
  end
  object FIELD_CKJLCSJJ_WZMC: TLookupCalcField
    ID = 'WZMC'
    DisplayName = #29289#36164#21517#31216
    DataType = dtString
    DataTypeAttribute.Size = 32
    EditStyleID = 'String'
    Alignment = taLeftJustify
    KeyField = 'SLDH'
    ResultField = 'MC'
    UseKeyFieldLookupDef = True
  end
  object FIELD_CKJLCSJJ_GG: TLookupCalcField
    ID = 'GG'
    DisplayName = #35268#26684
    DataType = dtString
    DataTypeAttribute.Size = 32
    EditStyleID = 'String'
    Alignment = taLeftJustify
    KeyField = 'SLDH'
    ResultField = 'GG'
    UseKeyFieldLookupDef = True
  end
  object FIELD_CKJLCSJJ_DW: TLookupCalcField
    ID = 'DW'
    DisplayName = #21333#20301
    DataType = dtString
    DataTypeAttribute.Size = 32
    EditStyleID = 'String'
    Alignment = taLeftJustify
    KeyField = 'SLDH'
    ResultField = 'DW'
    UseKeyFieldLookupDef = True
  end
  object FIELD_CKJLCSJJ_DJ: TLookupCalcField
    ID = 'DJ'
    DisplayName = #21333#20215
    DataType = dtNumber
    DataTypeAttribute.Precision = 19
    DataTypeAttribute.Scale = 2
    EditStyleID = 'Number'
    Alignment = taRightJustify
    KeyField = 'SLDH'
    ResultField = 'ZBDJ'
    UseKeyFieldLookupDef = True
  end
  object FIELD_CKJLCSJJ_JE: TExprCalcField
    ID = 'JE'
    DisplayName = #37329#39069
    DataType = dtNumber
    DataTypeAttribute.Precision = 19
    DataTypeAttribute.Scale = 2
    EditStyleID = 'Number'
    Alignment = taRightJustify
    Expression.Text = 'SL*DJ'
  end
end
回复

使用道具 举报

发表于 2007-9-12 12:04:19 | 显示全部楼层
楼主,提示已经很明确了,“执行更新数据的时候出现错误:ORA-00001: 违反唯一约束条”,检查你进去的数据,跟实际表中的数据,主键字段或者唯一字段 肯定有重复的了
回复 支持 反对

使用道具 举报

发表于 2007-9-13 16:04:07 | 显示全部楼层
??
回复 支持 反对

使用道具 举报

发表于 2007-9-13 17:15:30 | 显示全部楼层
跟数据集属性没有关系,是代码控制有问题,在QQ上确认过,已经解决了
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-1-16 01:46 , Processed in 0.038225 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表