|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册账号
×
本帖最后由 hugeng 于 2017-9-13 15:53 编辑
原来是用友U890,在升级到12.5时报错。
从2010年度到2017年度账套,只有其中的2013年度帐套升级失败。
提示:- 数据库名: UFDATA_010_2013
- C:\U8SOFT\Admin\SQLFILE10000\Main\Ufdata\Structure\data_str_pf_mix_nl.sql
- 错误信息:
- -2147217900
- 视图或函数 'voucheritems' 不可更新,因为修改会影响多个基表。
- 执行如下语句时出错:
- /*==========处理旧绩效表名===========*/
- if exists(select * from hr_sys_setdict_base where ctablecode='hr_pf_pfTable')
- begin
- ---删除查询分类
- delete from HR_BD_QueryClsAndSubClsRel where vSubClsCode in(select vSubClsCode from hr_bd_querysubclass where vsubclscode like 'pf%')
- delete from HR_BD_QueryIncludeSubCls where vSubClsCode in(select vSubClsCode from hr_bd_querysubclass where vsubclscode like 'pf%')
- delete from HR_BD_QueryShareField where vSubClsCode in(select vSubClsCode from hr_bd_querysubclass where vsubclscode like 'pf%')
- delete from hr_bd_querysubclass where vsubclscode like 'pf%'
- delete hr_bd_queryclass where vclscode like '10%' or vclscode like 'UD_10_%'
-
- ---删除报表
- delete from hr_bd_rpt_file where irptcode in(select iRptCode from hr_bd_rpt where vclscode like '10%' or vclscode like 'UD_10_%');
- delete from hr_bd_rpt_cond where irptcode in(select iRptCode from hr_bd_rpt where vclscode like '10%' or vclscode like 'UD_10_%');
- delete from hr_bd_rpt_conditem where irptcode in(select iRptCode from hr_bd_rpt where vclscode like '10%' or vclscode like 'UD_10_%');
- delete from hr_bd_rpt_section where irptcode in(select iRptCode from hr_bd_rpt where vclscode like '10%' or vclscode like 'UD_10_%');
- delete from hr_bd_rpt_auth where irptcode in(select iRptCode from hr_bd_rpt where vclscode like '10%' or vclscode like 'UD_10_%');
- delete from hr_bd_rpt_cond2 where irptcode in(select iRptCode from hr_bd_rpt where vclscode like '10%' or vclscode like 'UD_10_%');
- delete from hr_bd_rpt where irptcode in(select iRptCode from hr_bd_rpt where vclscode like '10%' or vclscode like 'UD_10_%');
- delete from hr_sys_function where csub_id ='pf'
- delete from hr_bd_rptdetail where vclscode like '10%'
- delete from hr_bd_rptdetail where vclscode like 'UD_10_%'
-
- ----删除单据、栏目信息
- delete from voucheritems where cardnum in(select cBusinessID from hr_bd_vouchertype where csub_id like 'pf%')
- delete from vouchers where CardNumber in(select cBusinessID from hr_bd_vouchertype where csub_id like 'pf%')
- delete from vouchertemplates where VT_CardNumber in(select cBusinessID from hr_bd_vouchertype where csub_id like 'pf%')
- delete from AA_ColumnDic where cKey in(select cBusinessID from hr_bd_vouchertype where csub_id like 'pf%')
- delete from AA_ColumnSet where cKey in(select cBusinessID from hr_bd_vouchertype where csub_id like 'pf%')
- delete from AA_ColumnAuthCache where cKey in(select cBusinessID from hr_bd_vouchertype where csub_id like 'pf%')
- delete from AA_ColumnDicCache_Main where cKey in(select cBusinessID from hr_bd_vouchertype where csub_id like 'pf%')
- delete from AA_ColumnDicCache_Detail where cKey in(select cBusinessID from hr_bd_vouchertype where csub_id like 'pf%')
- delete from hr_bd_vouchertype where csub_id like 'pf%'
- delete from hr_bd_vouchertable where ctablecode like 'hr_pf_%'
- delete from hr_bd_vouchertable where ctablecode like 'hr_v_pf_%'
- delete from Hr_bd_VoucherItem where ctablecode like 'hr_pf_%' or ctablecode like 'hr_v_pf_%'
- ---删除数据字典
- delete hr_sys_itemdict_Base where ctablecode like 'hr_pf_%' or ctablecode like 'hr_V_pf_%'
- delete from hr_sys_setdict_base where ctablecode like 'hr_pf_%' or ctablecode like 'hr_V_pf_%'
-
-
- end
- 效率测试报告:开始升级UFDATA_010_2013数据库
- data_str_pb_wfmodel_nl.SQL,2017-09-12 21:13:03 -- 2017-09-12 21:13:17,0小时0分钟14秒。
- data_str_pb_mommodel_nl.SQL,2017-09-12 21:13:17 -- 2017-09-12 21:13:20,0小时0分钟3秒。
- data_str_pb_portalmodel_nl.SQL,2017-09-12 21:13:20 -- 2017-09-12 21:13:26,0小时0分钟6秒。
- data_str_pb_ufsubmodel_nl.SQL,2017-09-12 21:13:26 -- 2017-09-12 21:13:27,0小时0分钟1秒。
- Data_STR_PB_DR_NL.SQL,2017-09-12 21:13:27 -- 2017-09-12 21:13:27,0小时0分钟0秒。
- Data_STR_PB_mix_NL.SQL,2017-09-12 21:13:27 -- 2017-09-12 21:13:30,0小时0分钟3秒。
- Data_STR_PB_Vou_NL.SQL,2017-09-12 21:13:30 -- 2017-09-12 21:13:31,0小时0分钟1秒。
- data_str_pb_uap_nl.SQL,2017-09-12 21:13:31 -- 2017-09-12 21:13:31,0小时0分钟0秒。
- data_str_pb_as_nl.SQL,2017-09-12 21:13:31 -- 2017-09-12 21:13:43,0小时0分钟12秒。
- data_str_pb_start_nl.SQL,2017-09-12 21:13:43 -- 2017-09-12 21:13:43,0小时0分钟0秒。
- data_str_pb_dae_nl.SQL,2017-09-12 21:13:43 -- 2017-09-12 21:13:43,0小时0分钟0秒。
- workflow_str_pb_mix_nl.SQL,2017-09-12 21:13:43 -- 2017-09-12 21:13:44,0小时0分钟1秒。
- Data_STR_SR_mix_NL.SQL,2017-09-12 21:13:44 -- 2017-09-12 21:13:46,0小时0分钟2秒。
- data_str_rt_mix_nl.SQL,2017-09-12 21:13:46 -- 2017-09-12 21:13:46,0小时0分钟0秒。
- data_str_ss_mix_nl.SQL,2017-09-12 21:13:46 -- 2017-09-12 21:13:46,0小时0分钟0秒。
- data_str_wa_mix_nl.SQL,2017-09-12 21:13:46 -- 2017-09-12 21:13:47,0小时0分钟1秒。
- Data_STR_HR_TM_mix_NL.SQL,2017-09-12 21:13:47 -- 2017-09-12 21:13:51,0小时0分钟4秒。
- Data_STR_HR_TR_mix_NL.SQL,2017-09-12 21:13:51 -- 2017-09-12 21:13:51,0小时0分钟0秒。
- data_str_ht_mix_nl.SQL,2017-09-12 21:13:51 -- 2017-09-12 21:13:51,0小时0分钟0秒。
- data_str_pr_mix_nl.SQL,2017-09-12 21:13:51 -- 2017-09-12 21:13:51,0小时0分钟0秒。
- 升级起始时间:2017-09-12 21:12:58,结束时间:2017-09-12 21:13:53,0小时0分钟55秒。
复制代码
将判断语句中的
select * from hr_sys_setdict_base where ctablecode='hr_pf_pfTable'
单独执行,在2013年度账套中无记录。在成功升级的2012年度帐套中也无记录。
单独分析其中出错的这句sql语句
delete from voucheritems where cardnum in(select cBusinessID from hr_bd_vouchertype where csub_id like 'pf%')
其中,
执行select cBusinessID from hr_bd_vouchertype where csub_id like 'pf%' 不管在2012、2013账套都无记录返回。
执行delete from voucheritems where cardnum in(select cBusinessID from hr_bd_vouchertype where csub_id like 'pf%')
2012年度正确执行。
2013年度报视图或函数 'voucheritems' 不可更新,因为修改会影响多个基表。
voucheritems 为视图,将2012、2013帐套中导出视图create脚本,比较后发现二者完全一致。
此视图引用了表:voucheritems_base、voucheritems_lang ,再次导出这二个表的create脚本、含索引、主外键等,比较后还是完全一致。
所以,不明白为什么
delete from voucheritems where cardnum in(select cBusinessID from hr_bd_vouchertype where csub_id like 'pf%')
在2012年度能正确执行,在2013年度就报错,请各位帮忙分析,谢谢。
|
|