|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册账号
×
前几天在论坛提问过,非常感谢大家的热心帮助,现在又遇到问题了。我已经照着演示帐套把pp_mrpoptma之类所有的pp_开头的表都加进去了,还是会出现这个错误提示,请帮我看看问题出在哪里好吗,我对数据库语言不大懂,谢谢
数据库名: UFDATA_001_2013
生产管理数据, DATA852_PP
错误信息:
-2147217900
插入错误: 列名或所提供值的数目与表定义不匹配。
执行如下语句时出错:
declare @dbname varchar(100)
select @dbname=DB_NAME()
--当前默认mrp方案升级
if(@dbname<>'UFModel')
begin
update pp_mrpoptma set bdefault=0
insert into pp_mrpoptma(
optcode,optname,bdefault,getdatafrom,bsafe,bfreez,bwasterate,bunchs,bfinishedrate,bunchp,bfree,bunchpr
)
select '当前方案','当前方案',1,
(select cvalue from accinformation where csysid='pp' and cname='getdatafrom'),
(select cvalue from accinformation where csysid='pp' and cname='bsafe'),
(select cvalue from accinformation where csysid='pp' and cname='bfreez'),
(select cvalue from accinformation where csysid='pp' and cname='bwasterate'),
(select cvalue from accinformation where csysid='pp' and cname='bunchs'),
(select cvalue from accinformation where csysid='pp' and cname='bfinishedrate'),
(select cvalue from accinformation where csysid='pp' and cname='bunchp'),
(select cvalue from accinformation where csysid='pp' and cname='bfree'),
(select cvalue from accinformation where csysid='pp' and cname='bunchpr')
insert into pp_mrpoptde
select b.mrpoptid, a.cwhcode, a.cwhname ,a.bmrp from warehouse a, pp_mrpoptma b where b.optcode='当前方案'
--当前默认rop方案升级
update pp_ropoptma set bdefault=0
insert into pp_ropoptma
(optcode, optname, bdefault, ihisdays, brfreez, bruncha, brunchp, brdelay)
select '当前方案','当前方案',1,
(select cvalue from accinformation where csysid='pp' and cname='ihisdays'),
(select cvalue from accinformation where csysid='pp' and cname='brfreez'),
(select cvalue from accinformation where csysid='pp' and cname='bruncha'),
(select cvalue from accinformation where csysid='pp' and cname='brunchp'),
(select cvalue from accinformation where csysid='pp' and cname='brdelay')
insert into pp_ropoptde
select b.ropoptid, a.cwhcode, a.cwhname ,a.brop from warehouse a, pp_ropoptma b where b.optcode='当前方案'
end
|
|