精細(xì)管理 · 敏捷經(jīng)營 · 快速應(yīng)用
規(guī)范流程 · 提升效益
規(guī)范管理 · 精細(xì)理財(cái)
自動編號: | 19417 | 產(chǎn)品版本: | 通2005 |
產(chǎn)品模塊: | 總賬 | 所屬行業(yè): | 通用 |
適用產(chǎn)品: | 關(guān) 鍵 字: | ||
問題名稱: | 發(fā)貨明細(xì)表功能錯誤 | ||
問題現(xiàn)象: | 發(fā)貨明細(xì)表(按存貨查詢)不能輸出 | ||
原因分析: | 可能是數(shù)據(jù)庫中各表之間有錯誤 | ||
解決方案: | 執(zhí)行腳本: Begin Declare @cItemName varchar(20) Set @cItemName = (Select cItemName from userDef Where cID = '01') If @cItemName Is Null update rpt_flddef set Name = '自定義項(xiàng)1' where Expression = 'cDefine1' And Id In (Select ID From Rpt_GlbDEF Where SystemID = 'SA' And Name In ('發(fā)貨明細(xì)表(貨物)', '發(fā)貨明細(xì)表(部門)', '發(fā)貨明細(xì)表(客戶)', '發(fā)貨明細(xì)表(業(yè)務(wù)員)', '發(fā)貨明細(xì)表(倉庫)')) else update rpt_flddef set Name = @cItemName where Expression = 'cDefine1' And Id In (Select ID From Rpt_GlbDEF Where SystemID = 'SA' And Name In ('發(fā)貨明細(xì)表(貨物)', '發(fā)貨明細(xì)表(部門)', '發(fā)貨明細(xì)表(客戶)', '發(fā)貨明細(xì)表(業(yè)務(wù)員)', '發(fā)貨明細(xì)表(倉庫)')) Set @cItemName = (Select cItemName from userDef Where cID = '02') If @cItemName Is Null update rpt_flddef set Name = '自定義項(xiàng)2' where Expression = 'cDefine2' And Id In (Select ID From Rpt_GlbDEF Where SystemID = 'SA' And Name In ('發(fā)貨明細(xì)表(貨物)', '發(fā)貨明細(xì)表(部門)', '發(fā)貨明細(xì)表(客戶)', '發(fā)貨明細(xì)表(業(yè)務(wù)員)', '發(fā)貨明細(xì)表(倉庫)')) else update rpt_flddef set Name = @cItemName where Expression = 'cDefine2' And Id In (Select ID From Rpt_GlbDEF Where SystemID = 'SA' And Name In ('發(fā)貨明細(xì)表(貨物)', '發(fā)貨明細(xì)表(部門)', '發(fā)貨明細(xì)表(客戶)', '發(fā)貨明細(xì)表(業(yè)務(wù)員)', '發(fā)貨明細(xì)表(倉庫)')) 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
|