电脑桌面
添加蚂蚁七词文库到电脑桌面
安装后可以在桌面快捷访问

NC常用脚本-修复每个年度12月份本年折旧错误脚本.txtVIP免费

NC常用脚本-修复每个年度12月份本年折旧错误脚本.txt_第1页
1/7
--按照组织修复错误的数据历史数据,我已经修复了其中的一个组织,那个组织12月没有结账;有的组织12月份已经结账了,使用的脚本不一样;--资产是从2013年开始使用的,也就是需要从2013年12月开始修复。--首先,在固定资产的月末结账节点查看该组织2016年12月份是否结账,如果没有结账,按照下面的步骤执行脚本:--1.查组织主键selectpk_financeorgfromorg_financeorgwherecode='组织编码';--2.查账簿主键selectpk_accountingbookfromorg_accountingbookwherecode='账簿编码';--3.请备份fa_cardhistorycreatetablefa_cardhistory_20170119asselect*fromfa_cardhistorywherepk_org='组织主键'andpk_accbook='账簿主键'anddr=0;--4.修复2013年11月份本年折旧错误脚本:通过以下脚本自动生成修复错误数据的脚本,执行后SELECT语句后,--再执行结果中返回的update开头的SQL语句即可修复数据(如果没有说明11月份没有问题,执行下一步)select'updatefa_cardhistorysetcurryeardep=depamount+'||curryeardep||'wherepk_cardhistory='''||pk_cardhistory||''';',z.*from(selecta.card_code,a.asset_code,b.depamount,c.curryeardep,a.pk_card,b.pk_cardhistoryfromfa_cardainnerjoin(selectpk_card,curryeardep,depamount,pk_cardhistoryfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2013andperiod=12andpk_org='组织主键'andpk_accbook='账簿主键')bona.pk_card=b.pk_cardinnerjoin(selectpk_card,curryeardepfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2013andperiod=11andpk_org='组织主键'andpk_accbook='账簿主键')conb.pk_card=c.pk_cardwherea.dr=0andc.curryeardep+b.depamount<>b.curryeardep)z--5.修复2013年12月份本年折旧错误脚本(修复完11月数据才能执行):通过以下脚本自动生成修复错误数据的脚本,执行后SELECT语句后,--再执行结果中返回的update开头的SQL语句即可修复数据:select'updatefa_cardhistorysetcurryeardep=depamount+'||curryeardep||'wherepk_cardhistory='''||pk_cardhistory||''';',z.*from(selecta.card_code,a.asset_code,b.depamount,c.curryeardep,a.pk_card,b.pk_cardhistoryfromfa_cardainnerjoin(selectpk_card,curryeardep,depamount,pk_cardhistoryfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2014andperiod=01andpk_org='组织主键'andpk_accbook='账簿主键')bona.pk_card=b.pk_cardinnerjoin(selectpk_card,curryeardepfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2013andperiod=12andpk_org='组织主键'andpk_accbook='账簿主键')conb.pk_card=c.pk_cardwherea.dr=0andc.curryeardep+b.depamount<>b.curryeardep)z--6.修复2014年11月份本年折旧错误脚本:通过以下脚本自动生成修复错误数据的脚本,执行后SELECT语句后,--再执行结果中返回的update开头的SQL语句即可修复数据(如果没有说明11月份没有问题,执行下一步)select'updatefa_cardhistorysetcurryeardep=depamount+'||curryeardep||'wherepk_cardhistory='''||pk_cardhistory||''';',z.*from(selecta.card_code,a.asset_code,b.depamount,c.curryeardep,a.pk_card,b.pk_cardhistoryfromfa_cardainnerjoin(selectpk_card,curryeardep,depamount,pk_cardhistoryfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2014andperiod=12andpk_org='组织主键'andpk_accbook='账簿主键')bona.pk_card=b.pk_cardinnerjoin(selectpk_card,curryeardepfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2014andperiod=11andpk_org='组织主键'andpk_accbook='账簿主键')conb.pk_card=c.pk_cardwherea.dr=0andc.curryeardep+b.depamount<>b.curryeardep)z--7.修复2014年12月份本年折旧错误脚本(修复完11月数据才能执行):通过以下脚本自动生成修复错误数据的脚本,执行后SELECT语句后,--再执行结果中返回的update开头的SQL语句即可修复数据:select'updatefa_cardhistorysetcurryeardep=depamount+'||curryeardep||'wherepk_cardhistory='''||pk_cardhistory||''';',z.*from(selecta.card_code,a.asset_code,b.depamount,c.curryeardep,a.pk_card,b.pk_cardhistoryfromfa_cardainnerjoin(selectpk_card,curryeardep,depamount,pk_cardhistoryfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2015andperiod=01andpk_org='组织主键'andpk_accbook='账簿主键')bona.pk_card=b.pk_cardinnerjoin(selectpk_card,curryeardepfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2014andperiod=12andpk_org='组织主键'andpk_accbook='账簿主键')conb.pk_card=c.pk_cardwherea.dr=0andc.curryeardep+b.depamount<>b.curryeardep)z--8.修复2015年11月份本年折旧错误脚本:通过以下脚本自动生成修复错误数据的脚本,执行后SELECT语句后,--再执行结果中返回的update开头的SQL语句即可修复数据(如果没有说明11月份没有问题,执行下一步)select'updatefa_cardhistorysetcurryeardep=depamount+'||curryeardep||'wherepk_cardhistory='''||pk_cardhistory||''';',z.*from(selecta.card_code,a.asset_code,b.depamount,c.curryeardep,a.pk_card,b.pk_cardhistoryfromfa_cardainnerjoin(selectpk_card,curryeardep,depamount,pk_cardhistoryfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2015andperiod=12andpk_org='组织主键'andpk_accbook='账簿主键')bona.pk_card=b.pk_cardinnerjoin(selectpk_card,curryeardepfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2015andperiod=11andpk_org='组织主键'andpk_accbook='账簿主键')conb.pk_card=c.pk_cardwherea.dr=0andc.curryeardep+b.depamount<>b.curryeardep)z--9.修复2015年12月份本年折旧错误脚本(修复完11月数据才能执行):通过以下脚本自动生成修复错误数据的脚本,执行后SELECT语句后,--再执行结果中返回的update开头的SQL语句即可修复数据:select'updatefa_cardhistorysetcurryeardep=depamount+'||curryeardep||'wherepk_cardhistory='''||pk_cardhistory||''';',z.*from(selecta.card_code,a.asset_code,b.depamount,c.curryeardep,a.pk_card,b.pk_cardhistoryfromfa_cardainnerjoin(selectpk_card,curryeardep,depamount,pk_cardhistoryfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2016andperiod=01andpk_org='组织主键'andpk_accbook='账簿主键')bona.pk_card=b.pk_cardinnerjoin(selectpk_card,curryeardepfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2015andperiod=12andpk_org='组织主键'andpk_accbook='账簿主键')conb.pk_card=c.pk_cardwherea.dr=0andc.curryeardep+b.depamount<>b.curryeardep)z--10.修复2016年11月份本年折旧错误脚本:通过以下脚本自动生成修复错误数据的脚本,执行后SELECT语句后,--再执行结果中返回的update开头的SQL语句即可修复数据(如果没有说明11月份没有问题,执行下一步)select'updatefa_cardhistorysetcurryeardep=depamount+'||curryeardep||'wherepk_cardhistory='''||pk_cardhistory||''';',z.*from(selecta.card_code,a.asset_code,b.depamount,c.curryeardep,a.pk_card,b.pk_cardhistoryfromfa_cardainnerjoin(selectpk_card,curryeardep,depamount,pk_cardhistoryfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2016andperiod=12andpk_org='组织主键'andpk_accbook='账簿主键')bona.pk_card=b.pk_cardinnerjoin(selectpk_card,curryeardepfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2016andperiod=11andpk_org='组织主键'andpk_accbook='账簿主键')conb.pk_card=c.pk_cardwherea.dr=0andc.curryeardep+b.depamount<>b.curryeardep)z--11.修复2016年12月份本年折旧错误脚本(修复完11月数据才能执行):通过以下脚本自动生成修复错误数据的脚本,执行后SELECT语句后,--再执行结果中返回的update开头的SQL语句即可修复数据:select'updatefa_cardhistorysetcurryeardep=depamount+'||curryeardep||'wherepk_cardhistory='''||pk_cardhistory||''';',z.*from(selecta.card_code,a.asset_code,b.depamount,c.curryeardep,a.pk_card,b.pk_cardhistoryfromfa_cardainnerjoin(selectpk_card,curryeardep,depamount,pk_cardhistoryfromfa_cardhistorywheredr=0andlaststate_flag='Y'andaccyear=2016andperiod=12andpk_org='组织主键'andpk_accbook='账簿主键')bona.pk_card=b.pk_cardinnerjoin(selectpk_card,curryeardepfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2016andperiod=12andpk_org='组织主键'andpk_accbook='账簿主键')conb.pk_card=c.pk_cardwherea.dr=0andc.curryeardep+b.depamount<>b.curryeardep)z--12提交commit;--其次,在固定资产的月末结账节点查看该组织2016年12月份是否结账,如果已经结账,按照下面的步骤执行脚本:--1.查组织主键selectpk_financeorgfromorg_financeorgwherecode='组织编码';--2.查账簿主键selectpk_accountingbookfromorg_accountingbookwherecode='账簿编码';--3.请备份fa_cardhistorycreatetablefa_cardhistory_20170119asselect*fromfa_cardhistorywherepk_org='组织主键'andpk_accbook='账簿主键'anddr=0;--4.修复2013年11月份本年折旧错误脚本:通过以下脚本自动生成修复错误数据的脚本,执行后SELECT语句后,--再执行结果中返回的update开头的SQL语句即可修复数据(如果没有说明11月份没有问题,执行下一步)select'updatefa_cardhistorysetcurryeardep=depamount+'||curryeardep||'wherepk_cardhistory='''||pk_cardhistory||''';',z.*from(selecta.card_code,a.asset_code,b.depamount,c.curryeardep,a.pk_card,b.pk_cardhistoryfromfa_cardainnerjoin(selectpk_card,curryeardep,depamount,pk_cardhistoryfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2013andperiod=12andpk_org='组织主键'andpk_accbook='账簿主键')bona.pk_card=b.pk_cardinnerjoin(selectpk_card,curryeardepfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2013andperiod=11andpk_org='组织主键'andpk_accbook='账簿主键')conb.pk_card=c.pk_cardwherea.dr=0andc.curryeardep+b.depamount<>b.curryeardep)z--5.修复2013年12月份本年折旧错误脚本(修复完11月数据才能执行):通过以下脚本自动生成修复错误数据的脚本,执行后SELECT语句后,--再执行结果中返回的update开头的SQL语句即可修复数据:select'updatefa_cardhistorysetcurryeardep=depamount+'||curryeardep||'wherepk_cardhistory='''||pk_cardhistory||''';',z.*from(selecta.card_code,a.asset_code,b.depamount,c.curryeardep,a.pk_card,b.pk_cardhistoryfromfa_cardainnerjoin(selectpk_card,curryeardep,depamount,pk_cardhistoryfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2014andperiod=01andpk_org='组织主键'andpk_accbook='账簿主键')bona.pk_card=b.pk_cardinnerjoin(selectpk_card,curryeardepfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2013andperiod=12andpk_org='组织主键'andpk_accbook='账簿主键')conb.pk_card=c.pk_cardwherea.dr=0andc.curryeardep+b.depamount<>b.curryeardep)z--6.修复2014年11月份本年折旧错误脚本:通过以下脚本自动生成修复错误数据的脚本,执行后SELECT语句后,--再执行结果中返回的update开头的SQL语句即可修复数据(如果没有说明11月份没有问题,执行下一步)select'updatefa_cardhistorysetcurryeardep=depamount+'||curryeardep||'wherepk_cardhistory='''||pk_cardhistory||''';',z.*from(selecta.card_code,a.asset_code,b.depamount,c.curryeardep,a.pk_card,b.pk_cardhistoryfromfa_cardainnerjoin(selectpk_card,curryeardep,depamount,pk_cardhistoryfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2014andperiod=12andpk_org='组织主键'andpk_accbook='账簿主键')bona.pk_card=b.pk_cardinnerjoin(selectpk_card,curryeardepfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2014andperiod=11andpk_org='组织主键'andpk_accbook='账簿主键')conb.pk_card=c.pk_cardwherea.dr=0andc.curryeardep+b.depamount<>b.curryeardep)z--7.修复2014年12月份本年折旧错误脚本(修复完11月数据才能执行):通过以下脚本自动生成修复错误数据的脚本,执行后SELECT语句后,--再执行结果中返回的update开头的SQL语句即可修复数据:select'updatefa_cardhistorysetcurryeardep=depamount+'||curryeardep||'wherepk_cardhistory='''||pk_cardhistory||''';',z.*from(selecta.card_code,a.asset_code,b.depamount,c.curryeardep,a.pk_card,b.pk_cardhistoryfromfa_cardainnerjoin(selectpk_card,curryeardep,depamount,pk_cardhistoryfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2015andperiod=01andpk_org='组织主键'andpk_accbook='账簿主键')bona.pk_card=b.pk_cardinnerjoin(selectpk_card,curryeardepfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2014andperiod=12andpk_org='组织主键'andpk_accbook='账簿主键')conb.pk_card=c.pk_cardwherea.dr=0andc.curryeardep+b.depamount<>b.curryeardep)z--8.修复2015年11月份本年折旧错误脚本:通过以下脚本自动生成修复错误数据的脚本,执行后SELECT语句后,--再执行结果中返回的update开头的SQL语句即可修复数据(如果没有说明11月份没有问题,执行下一步)select'updatefa_cardhistorysetcurryeardep=depamount+'||curryeardep||'wherepk_cardhistory='''||pk_cardhistory||''';',z.*from(selecta.card_code,a.asset_code,b.depamount,c.curryeardep,a.pk_card,b.pk_cardhistoryfromfa_cardainnerjoin(selectpk_card,curryeardep,depamount,pk_cardhistoryfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2015andperiod=12andpk_org='组织主键'andpk_accbook='账簿主键')bona.pk_card=b.pk_cardinnerjoin(selectpk_card,curryeardepfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2015andperiod=11andpk_org='组织主键'andpk_accbook='账簿主键')conb.pk_card=c.pk_cardwherea.dr=0andc.curryeardep+b.depamount<>b.curryeardep)z--9.修复2015年12月份本年折旧错误脚本(修复完11月数据才能执行):通过以下脚本自动生成修复错误数据的脚本,执行后SELECT语句后,--再执行结果中返回的update开头的SQL语句即可修复数据:select'updatefa_cardhistorysetcurryeardep=depamount+'||curryeardep||'wherepk_cardhistory='''||pk_cardhistory||''';',z.*from(selecta.card_code,a.asset_code,b.depamount,c.curryeardep,a.pk_card,b.pk_cardhistoryfromfa_cardainnerjoin(selectpk_card,curryeardep,depamount,pk_cardhistoryfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2016andperiod=01andpk_org='组织主键'andpk_accbook='账簿主键')bona.pk_card=b.pk_cardinnerjoin(selectpk_card,curryeardepfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2015andperiod=12andpk_org='组织主键'andpk_accbook='账簿主键')conb.pk_card=c.pk_cardwherea.dr=0andc.curryeardep+b.depamount<>b.curryeardep)z--10.修复2016年11月份本年折旧错误脚本:通过以下脚本自动生成修复错误数据的脚本,执行后SELECT语句后,--再执行结果中返回的update开头的SQL语句即可修复数据(如果没有说明11月份没有问题,执行下一步)select'updatefa_cardhistorysetcurryeardep=depamount+'||curryeardep||'wherepk_cardhistory='''||pk_cardhistory||''';',z.*from(selecta.card_code,a.asset_code,b.depamount,c.curryeardep,a.pk_card,b.pk_cardhistoryfromfa_cardainnerjoin(selectpk_card,curryeardep,depamount,pk_cardhistoryfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2016andperiod=12andpk_org='组织主键'andpk_accbook='账簿主键')bona.pk_card=b.pk_cardinnerjoin(selectpk_card,curryeardepfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2016andperiod=11andpk_org='组织主键'andpk_accbook='账簿主键')conb.pk_card=c.pk_cardwherea.dr=0andc.curryeardep+b.depamount<>b.curryeardep)z--11.修复2016年12月份本年折旧错误脚本:通过以下脚本自动生成修复错误数据的脚本,执行后SELECT语句后,--再执行结果中返回的update开头的SQL语句即可修复数据(如果没有说明11月份没有问题,执行下一步)select'updatefa_cardhistorysetcurryeardep=depamount+'||curryeardep||'wherepk_cardhistory='''||pk_cardhistory||''';',z.*from(selecta.card_code,a.asset_code,b.depamount,c.curryeardep,a.pk_card,b.pk_cardhistoryfromfa_cardainnerjoin(selectpk_card,curryeardep,depamount,pk_cardhistoryfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2017andperiod=01andpk_org='组织主键'andpk_accbook='账簿主键')bona.pk_card=b.pk_cardinnerjoin(selectpk_card,curryeardepfromfa_cardhistorywheredr=0andlaststate_flag='N'andaccyear=2016andperiod=12andpk_org='组织主键'andpk_accbook='账簿主键')conb.pk_card=c.pk_cardwherea.dr=0andc.curryeardep+b.depamount<>b.curryeardep)z--12提交commit;

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

NC常用脚本-修复每个年度12月份本年折旧错误脚本.txt

您可能关注的文档

管理软件+ 关注
实名认证
内容提供者

管理软件资料分享

确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息
QQ群
  • 答案:my7c点击这里加入QQ群
支持邮箱
微信
  • 微信