自动编号: | 19417 | 产品版本: | 通2005 |
产品模块: | 总账 | 所属行业: | 通用 |
适用产品: | 关 键 字: | ||
问题名称: | 发货明细表功能错误 | ||
问题现象: | 发货明细表(按存货查询)不能输出 | ||
原因分析: | 可能是数据库中各表之间有错误 | ||
解决方案: | 执行脚本: Begin Declare @cItemName varchar(20) Set @cItemName = (Select cItemName from userDef Where cID = '01') If @cItemName Is Null update rpt_flddef set Name = '自定义项1' where Expression = 'cDefine1' And Id In (Select ID From Rpt_GlbDEF Where SystemID = 'SA' And Name In ('发货明细表(货物)', '发货明细表(部门)', '发货明细表(客户)', '发货明细表(业务员)', '发货明细表(仓库)')) else update rpt_flddef set Name = @cItemName where Expression = 'cDefine1' And Id In (Select ID From Rpt_GlbDEF Where SystemID = 'SA' And Name In ('发货明细表(货物)', '发货明细表(部门)', '发货明细表(客户)', '发货明细表(业务员)', '发货明细表(仓库)')) Set @cItemName = (Select cItemName from userDef Where cID = '02') If @cItemName Is Null update rpt_flddef set Name = '自定义项2' where Expression = 'cDefine2' And Id In (Select ID From Rpt_GlbDEF Where SystemID = 'SA' And Name In ('发货明细表(货物)', '发货明细表(部门)', '发货明细表(客户)', '发货明细表(业务员)', '发货明细表(仓库)')) else update rpt_flddef set Name = @cItemName where Expression = 'cDefine2' And Id In (Select ID From Rpt_GlbDEF Where SystemID = 'SA' And Name In ('发货明细表(货物)', '发货明细表(部门)', '发货明细表(客户)', '发货明细表(业务员)', '发货明细表(仓库)')) end --重新排序 Begin Declare @ID_Field int Declare @iOrderEx int Set @iOrderEx = 0 Declare Fld_Cur Cursor For Select ID_Field from Rpt_FldDEF Where Id = 1362 And ModeEx = 0 order by OrderEx Open Fld_cur Fetch Next FROM Fld_Cur Into @ID_Field WHILE @@FETCH_STATUS = 0 Begin Set @iOrderEx = @iOrderEx + 1 Update Rpt_FldDef Set OrderEx = @iOrderEx Where Id = 1362 And ModeEx = 0 And ID_Field = @ID_Field Fetch Next FROM Fld_Cur Into @ID_Field End CLOSE Fld_Cur DEALLOCATE Fld_Cur DELETE FROM Rpt_FldDEF Where Id = 1362 And ModeEx = 0 And Expression = 'cDefine22' End
|