搜索
查看: 152|回复: 2

[求助] 850升级到12.0

[复制链接]
发表于 2017-3-20 22:11:16 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?注册账号

x
860[Main]升级
关闭了系统数据库连接
重新打开了系统数据库连接
开始读取升级列表
结束读取升级列表
开始事务
数据库名: UFDATA_004_2006
C:\U8SOFT\Admin\SQLFILE8600\Main\Ufdata\DPRD860_REPORT_PU__UP.sql
错误信息:
-2147467259
子查询返回的值不止一个。当子查询跟随在 =、!=、<、<=、>、>= 之后,或子查询用作表达式时,这种情况是不允许的。
执行如下语句时出错:
/*************************************修改报表 采购订单预警和报警表 结束*********************************************/


--<Strategy RunType='skip'></Strategy>
/*************************************修改报表 订单执行统计表 定义*********************************************/
declare @ID int
declare @columnid int
declare @IsSysUsed int
set @ID = (select ID from rpt_glbdef where systemid='PU' and (name='订单执行统计表' OR name='采购订单执行统计表'))
/*判断是否执行新建帐套脚本(系统未启用时)*/
exec sp_IsSubSysUsed @sysid='PU',@IsUsed =@IsSysUsed output
/*帐套升级的处理脚本(系统启用时)*/
IF @IsSysUsed=1
BEGIN
    update rpt_glbdef set Name='采购订单执行统计表',Title='采购订单执行统计表' where  SystemID='PU' and Name='订单执行统计表'
    /*新增报表列 列名1161 合计定义 */
    insert into rpt_flddef ( ID,Name,ModeEx,OrderEx,TopEx,LeftEx,Width,Height,Visible,nameForeign,iColSize,iAlignStyle,iSize )  values ( @ID,'列名1161',4,-1,0,0,0,0,0,'列名1161',0,0,0 )
    /*修改报表列 退货数量 合计定义 */
    update rpt_flddef set OrderEx=0 where  ID=@ID and Name='退货数量' and ModeEx=4
    /*新增报表列 cDefine5 合计定义 */
    insert into rpt_flddef ( ID,Name,ModeEx,OrderEx,TopEx,LeftEx,Width,Height,Visible,nameForeign,iColSize,iAlignStyle,iSize )  values ( @ID,'cDefine5',4,-1,0,0,0,0,0,'cDefine5',0,0,0 )
    /*新增报表列 销售订单号 定义*/
    set @columnid = (select isnull(max(orderex),0) +1 from rpt_flddef where id =@ID and modeex =0 )
    insert into rpt_flddef ( ID,Name,Expression,Condition,ModeEx,OrderEx,TopEx,LeftEx,Width,Visible,Note,iColSize,FormatEx,iAlignStyle,iSize )  values ( @ID,'销售订单号','销售订单号','',0,@columnid,1,0,0,0,'',1005,'',1,1 )
    /*新增报表列 销售订单行号 定义*/
    set @columnid = @columnid+1
    insert into rpt_flddef ( ID,Name,Expression,Condition,ModeEx,OrderEx,TopEx,LeftEx,Width,Visible,Note,iColSize,FormatEx,iAlignStyle,iSize )  values ( @ID,'销售订单行号','销售订单行号','',0,@columnid,1,0,0,0,'',1005,'0',3,0 )
    /*新增报表列 销售订单行号 合计定义 */
    insert into rpt_flddef ( ID,Name,ModeEx,OrderEx,TopEx,LeftEx,Width,Height,Visible,nameForeign,iColSize,iAlignStyle,iSize )  values ( @ID,'销售订单行号',4,-1,0,0,0,0,0,'销售订单行号',0,0,0 )
    /*新增报表列 cDefine7 合计定义 */
    insert into rpt_flddef ( ID,Name,ModeEx,OrderEx,TopEx,LeftEx,Width,Height,Visible,nameForeign,iColSize,iAlignStyle,iSize )  values ( @ID,'cDefine7',4,-1,0,0,0,0,0,'cDefine7',0,0,0 )
    /*新增报表列 客户编码 定义*/
    set @columnid = @columnid+1
    insert into rpt_flddef ( ID,Name,Expression,Condition,ModeEx,OrderEx,TopEx,LeftEx,Width,Visible,Note,iColSize,FormatEx,iAlignStyle,iSize )  values ( @ID,'客户编码','客户编码','',0,@columnid,1,0,0,0,'',1005,'',1,1 )
    /*新增报表列 客户简称 定义*/
    set @columnid = @columnid+1
    insert into rpt_flddef ( ID,Name,Expression,Condition,ModeEx,OrderEx,TopEx,LeftEx,Width,Visible,Note,iColSize,FormatEx,iAlignStyle,iSize )  values ( @ID,'客户简称','客户简称','',0,@columnid,1,0,0,0,'',1005,'',1,1 )
    /*新增报表列 合同号 定义*/
    set @columnid = @columnid+1
    insert into rpt_flddef ( ID,Name,Expression,Condition,ModeEx,OrderEx,TopEx,LeftEx,Width,Visible,Note,iColSize,FormatEx,iAlignStyle,iSize )  values ( @ID,'合同号','合同号','',0,@columnid,1,0,0,0,'',1000,'',1,1 )
    /*新增报表列 合同标的编码 定义*/
    set @columnid = @columnid+1
    insert into rpt_flddef ( ID,Name,Expression,Condition,ModeEx,OrderEx,TopEx,LeftEx,Width,Visible,Note,iColSize,FormatEx,iAlignStyle,iSize )  values ( @ID,'合同标的编码','合同标的编码','',0,@columnid,1,0,0,0,'',1000,'',1,1 )
    /*新增报表列 cDefine15 合计定义 */
    insert into rpt_flddef ( ID,Name,ModeEx,OrderEx,TopEx,LeftEx,Width,Height,Visible,nameForeign,iColSize,iAlignStyle,iSize )  values ( @ID,'cDefine15',4,-1,0,0,0,0,0,'cDefine15',0,0,0 )
    /*新增报表列 cDefine16 合计定义 */
    insert into rpt_flddef ( ID,Name,ModeEx,OrderEx,TopEx,LeftEx,Width,Height,Visible,nameForeign,iColSize,iAlignStyle,iSize )  values ( @ID,'cDefine16',4,-1,0,0,0,0,0,'cDefine16',0,0,0 )
    /*新增报表列 cDefine26 合计定义 */
    insert into rpt_flddef ( ID,Name,ModeEx,OrderEx,TopEx,LeftEx,Width,Height,Visible,nameForeign,iColSize,iAlignStyle,iSize )  values ( @ID,'cDefine26',4,-1,0,0,0,0,0,'cDefine26',0,0,0 )
    /*新增报表列 cDefine27 合计定义 */
    insert into rpt_flddef ( ID,Name,ModeEx,OrderEx,TopEx,LeftEx,Width,Height,Visible,nameForeign,iColSize,iAlignStyle,iSize )  values ( @ID,'cDefine27',4,-1,0,0,0,0,0,'cDefine27',0,0,0 )
    /*新增报表列 cDefine34 合计定义 */
    insert into rpt_flddef ( ID,Name,ModeEx,OrderEx,TopEx,LeftEx,Width,Height,Visible,nameForeign,iColSize,iAlignStyle,iSize )  values ( @ID,'cDefine34',4,-1,0,0,0,0,0,'cDefine34',0,0,0 )
    /*新增报表列 cDefine35 合计定义 */
    insert into rpt_flddef ( ID,Name,ModeEx,OrderEx,TopEx,LeftEx,Width,Height,Visible,nameForeign,iColSize,iAlignStyle,iSize )  values ( @ID,'cDefine35',4,-1,0,0,0,0,0,'cDefine35',0,0,0 )
    /*新增报表列 cinvDefine11 合计定义 */
    insert into rpt_flddef ( ID,Name,ModeEx,OrderEx,TopEx,LeftEx,Width,Height,Visible,nameForeign,iColSize,iAlignStyle,iSize )  values ( @ID,'cinvDefine11',4,-1,0,0,0,0,0,'cinvDefine11',0,0,0 )
    /*新增报表列 cinvDefine12 合计定义 */
    insert into rpt_flddef ( ID,Name,ModeEx,OrderEx,TopEx,LeftEx,Width,Height,Visible,nameForeign,iColSize,iAlignStyle,iSize )  values ( @ID,'cinvDefine12',4,-1,0,0,0,0,0,'cinvDefine12',0,0,0 )
    /*新增报表列 cinvDefine13 合计定义 */
    insert into rpt_flddef ( ID,Name,ModeEx,OrderEx,TopEx,LeftEx,Width,Height,Visible,nameForeign,iColSize,iAlignStyle,iSize )  values ( @ID,'cinvDefine13',4,-1,0,0,0,0,0,'cinvDefine13',0,0,0 )
    /*新增报表列 cinvDefine14 合计定义 */
    insert into rpt_flddef ( ID,Name,ModeEx,OrderEx,TopEx,LeftEx,Width,Height,Visible,nameForeign,iColSize,iAlignStyle,iSize )  values ( @ID,'cinvDefine14',4,-1,0,0,0,0,0,'cinvDefine14',0,0,0 )
    /*新增报表列 cVenDefine11 合计定义 */
    insert into rpt_flddef ( ID,Name,ModeEx,OrderEx,TopEx,LeftEx,Width,Height,Visible,nameForeign,iColSize,iAlignStyle,iSize )  values ( @ID,'cVenDefine11',4,-1,0,0,0,0,0,'cVenDefine11',0,0,0 )
    /*新增报表列 cVenDefine12 合计定义 */
    insert into rpt_flddef ( ID,Name,ModeEx,OrderEx,TopEx,LeftEx,Width,Height,Visible,nameForeign,iColSize,iAlignStyle,iSize )  values ( @ID,'cVenDefine12',4,-1,0,0,0,0,0,'cVenDefine12',0,0,0 )
    /*新增报表列 cVenDefine13 合计定义 */
    insert into rpt_flddef ( ID,Name,ModeEx,OrderEx,TopEx,LeftEx,Width,Height,Visible,nameForeign,iColSize,iAlignStyle,iSize )  values ( @ID,'cVenDefine13',4,-1,0,0,0,0,0,'cVenDefine13',0,0,0 )
    /*新增报表列 cVenDefine14 合计定义 */
    insert into rpt_flddef ( ID,Name,ModeEx,OrderEx,TopEx,LeftEx,Width,Height,Visible,nameForeign,iColSize,iAlignStyle,iSize )  values ( @ID,'cVenDefine14',4,-1,0,0,0,0,0,'cVenDefine14',0,0,0 )
    /*新增报表过滤条件 Po_PoMain.cDefine5 定义*/
    set @columnid = (select isnull(max(location),0) +1 from rpt_fltdef where id =@ID and modeex <20 )
    insert into rpt_fltdef ( Location,ID,Name,Note,Expression,ModeEx,IsSingle,Flag,iLeft,iTop,iWidth,iHeight,iCaptionLeft,iCaptionWidth,iPage,iRefSelect )  values ( @columnid,@ID,'Po_PoMain.cDefine5','表头自定义5','',-1,1,0,0,0,0,0,0,1,1,1 )
    /*新增报表过滤条件 Po_PoMain.cDefine7 定义*/
    set @columnid =@columnid+1
    insert into rpt_fltdef ( Location,ID,Name,Note,Expression,ModeEx,IsSingle,Flag,iLeft,iTop,iWidth,iHeight,iCaptionLeft,iCaptionWidth,iPage,iRefSelect )  values ( @columnid,@ID,'Po_PoMain.cDefine7','表头自定义7','',-1,1,0,0,0,0,0,0,1,1,1 )
    /*新增报表过滤条件 Po_Pomain.cDefine10 定义*/
    set @columnid =@columnid+1
    insert into rpt_fltdef ( Location,ID,Name,Note,Expression,ModeEx,IsSingle,Flag,iLeft,iTop,iWidth,iHeight,iCaptionLeft,iCaptionWidth,iPage,iRefSelect )  values ( @columnid,@ID,'Po_Pomain.cDefine10','表头自定义10','select cvalue  from userdefine where cid =''10''
',1,1,0,1,0,0,0,0,1,1,1 )
    /*新增报表过滤条件 Po_Pomain.cDefine11 定义*/
    set @columnid =@columnid+1
    insert into rpt_fltdef ( Location,ID,Name,Note,Expression,ModeEx,IsSingle,Flag,iLeft,iTop,iWidth,iHeight,iCaptionLeft,iCaptionWidth,iPage,iRefSelect )  values ( @columnid,@ID,'Po_Pomain.cDefine11','表头自定义11','select cvalue  from userdefine where cid =''36''',1,1,0,1,0,0,0,0,1,1,1 )
    /*新增报表过滤条件 Po_Pomain.cDefine12 定义*/
    set @columnid =@columnid+1
   
    insert into rpt_fltdef ( Location,ID,Name,Note,Expression,ModeEx,IsSingle,Flag,iLeft,iTop,iWidth,iHeight,iCaptionLeft,iCaptionWidth,iPage,iRefSelect )  values ( @columnid,@ID,'Po_Podetails.cDefine31','表体自定义10','select cvalue  from userdefine where cid =''45''',1,1,0,1,0,0,0,0,1,1,1 )
    /*新增报表过滤条件 Po_Podetails.cDefine32 定义*/
    set @columnid =@columnid+1
    insert into rpt_fltdef ( Location,ID,Name,Note,Expression,ModeEx,IsSingle,Flag,iLeft,iTop,iWidth,iHeight,iCaptionLeft,iCaptionWidth,iPage,iRefSelect )      delete from  rpt_flddef where   ID=@ID and Name='标签12' and ModeEx=26
    /*删除报表标签标签15定义*/
    delete from  rpt_flddef where   ID=@ID and Name='标签15' and ModeEx=26
END
ELSE
/*系统未启用的处理脚本*/
BEGIN
    /*首先删除可能重复的定义*/
    Delete from rpt_glbdef where id=@ID
    Delete from rpt_flddef where id=@ID
    Delete from rpt_fltdef where id=@ID
    /*新增自定义报表*/
     Insert into Rpt_GlbDef  ( [SystemID],[Name],[Title],[DatabaseEx],[WhereEx],[Predicate],[Type],[Relation],[Note],[Cols],[Section],[Fields],[DataSource],[BaseTable],[IsBaseTable],[IsControlCreate],[IsBase],[GroupDefine] ) Values ( 'PU','采购订单执行统计表','采购订单执行统计表', Null,'PU030502', Null,77,'heron', Null,0,0,0, Null, Null,1,0,0, Null )
      Update Rpt_GlbDef Set Relation = 'heron'   Where SystemID = 'PU' and Name = '采购订单执行统计表'
    /*处理采购订单执行统计表的 Rpt_fldDef 数据*/
    Set @ID = ( Select ID from Rpt_GlbDEF Where SystemID='PU' And Name ='采购订单执行统计表')
    Insert into Rpt_fldDef ( [ID],[Name],[Expression],[Condition],[ModeEx],[OrderEx],[TopEx],[LeftEx],[Width],[Height],[Visible],[Note],[nameForeign],[iColSize],[FormatEx],[iAlignStyle],[iSize] ) Values ( @ID,'列名1161','','',0,0,1,0,0,300,-1,'', Null,1000,'',0,0 )
    Insert into Rpt_fldDef ( [ID],[Name],[Expression],[Condition],[ModeEx],[OrderEx],[TopEx],[LeftEx],[Width],[Height],[Visible],[Note],[nameForeign],[iColSize],[FormatEx],[iAlignStyle],[iSize] ) Values ( @ID,'cPOID','cPOID','',0,1,0,0,0,300,-1,'', Null,1275,'',1,1 )
    Insert into Rpt_fldDef ( [ID],[Name],[Expression],[Condition],[ModeEx],[OrderEx],[TopEx],[LeftEx],[Width],[Height],[Visible],[Note],[nameForeign],[iColSize],[FormatEx],[iAlignStyle],[iSize] ) Values ( @ID,'cVenCode','cVenCode','',0,2,0,0,0,300,0,'', Null,1365,'',1,1 )
    Insert into Rpt_fldDef ( [ID],[Name],[Expression],[Condition],[ModeEx],[OrderEx],[TopEx],[LeftEx],[Width],[Height],[Visible],[Note],[nameForeign],[iColSize],[FormatEx],[iAlignStyle],[iSize] ) Values ( @ID,'cVenAbbName','cVenAbbName','',0,3,0,0,0,300,-1,'', Null,2205,'',1,1 )
    Insert into Rpt_fldDef ( [ID],[Name],[Expression],[Condition],[ModeEx],[OrderEx],[TopEx],[LeftEx],[Width],[Height],[Visible],[Note],[nameForeign],[iColSize],[FormatEx],[iAlignStyle],[iSize] ) Values ( @ID,'cInvCode','cInvCode','',0,4,0,0,0,300,0,'', Null,1005,'',1,1 )
    ible],[Note],[nameForeign],[iColSize],[FormatEx],[iAlignStyle],[iSize] ) Values ( @ID,'标签25','【用友软件】','False,134,False,宋体,9,False,False,400',26,21,500,8180,2035,300,0,'文本;;','页脚注区域',0,'显示/打印',0,0 )
    Insert into Rpt_fldDef ( [ID],[Name],[Expression],[Condition],[ModeEx],[OrderEx],[TopEx],[LeftEx],[Width],[Height],[Visible],[Note],[nameForeign],[iColSize],[FormatEx],[iAlignStyle],[iSize] ) Values ( @ID,'标签26','GetReportName()','False,134,False,黑体,15,False,False,400',26,22,112,0,0,504,0,'公式;;系统内置公式','标题区域',0,'只打印',2,0 )
    Insert into Rpt_fldDef ( [ID],[Name],[Expression],[Condition],[ModeEx],[OrderEx],[TopEx],[LeftEx],[Width],[Height],[Visible],[Note],[nameForeign],[iColSize],[FormatEx],[iAlignStyle],[iSize] ) Values ( @ID,'标签27','Pages()','False,134,False,宋体,9,False,False,400',26,23,900,7740,1000,300,0,'公式;;系统内置公式','页脚注区域',0,'显示/打印',2,0 )
   秒。
DPRD860_IA.SQL,2012-10-11 21:49:01 -- 2012-10-11 21:49:02,0小时0分钟1秒。
DPRO860_CM.SQL,2012-10-11 21:49:02 -- 2012-10-11 21:49:04,0小时0分钟2秒。
DPRD860_CM.SQL,2012-10-11 21:49:04 -- 2012-10-11 21:49:12,0小时0分钟8秒。
DPRO860_ST_PU.SQL,2012-10-11 21:49:12 -- 2012-10-11 21:49:12,0小时0分钟0秒。
DPRO860_PU.SQL,2012-10-11 21:49:12 -- 2012-10-11 21:49:14,0小时0分钟2秒。
DPRD860_AUTH_PU__UP.SQL,2012-10-11 21:49:14 -- 2012-10-11 21:49:14,0小时0分钟0秒。
DPRD860_COLUMNDIC_PU__UP.SQL,2012-10-11 21:49:14 -- 2012-10-11 21:49:17,0小时0分钟3秒。
    升级起始时间:2012-10-11 21:45:56,结束时间:2012-10-11 21:49:41,0小时3分钟45秒。
发表于 2017-3-20 23:08:24 | 显示全部楼层
你发的都是表象,关键的过程你没有说,,咋个帮你那?
回复 支持 反对

使用道具 举报

发表于 2017-3-20 23:29:06 | 显示全部楼层
select ID from rpt_glbdef where systemid='PU' and (name='订单执行统计表' OR name='采购订单执行统计表') 在升级报错的年度执行下看看,应该只能查出一条记录,有重复的记录自己辨别删除
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号

本版积分规则

Archiver|手机版|用友之家 ( 蜀ICP备07505338号 ) 川公网安备 51072502110008号

GMT+8, 2017-7-26 08:29 , Processed in 0.090343 second(s), 19 queries , Gzip On, MemCache On.

Powered by Discuz! X3.3

© 2005-2017

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