发布网友
共3个回答
热心网友
BEGIN
IF EXISTS(select 1 from rw_yzs_Static where pagetype =i_pagetype and catalogCode = i_catalogCode and serviceCode = i_serviceCode and serviceName = i_serviceName) THEN
update rw_yzs_Static set serviceCode=i_serviceCode,serviceName=i_serviceName,zgbb =i_zgbb,sxmc =i_sxmc,cnqx =i_cnqx,sfbz =i_sfbz,dz =i_dz,bldx = i_bldx,bltj =i_bltj,sxcl =i_sxcl,ckbllc =i_ckbllc,wsbllc = i_wsbllc,blsx =i_blsx,blyj = i_blyj,bz =i_bz,updatetime = NOW()
where pagetype =i_pagetype and catalogCode = i_catalogCode and serviceCode = i_serviceCode and serviceName = i_serviceName;
ELSE
INSERT INTO rw_yzs_Static (pagetype,divisioncode,divisionname,catalogCode,catalogName,serviceCode,serviceName,orgGroup,zgbb,sxmc,cnqx,sfbz,dz,bldx,bltj,sxcl,ckbllc,wsbllc,blsx,blyj,bz,updatetime)
VALUES(i_pagetype,i_divisioncode,i_divisionname,i_catalogCode,i_catalogName,i_serviceCode,i_serviceName,i_orgGroup,i_zgbb,i_sxmc,i_cnqx,i_sfbz,i_dz,i_bldx,i_bltj,i_sxcl,i_ckbllc,i_wsbllc,i_blsx,i_blyj,i_bz,now());
END IF;
END
例子与回答无关:
这里应该用case when then 这类的吧
这里给个思路,具体用法还是自己去百度吧。应该太多了这种教学。
select case 学分 when <60 then xf=0 from xscj where 学号=xh and 课程名称 =kcmc
你里你应该新增一个变量来记录成绩的值 才能对此进行IF判断
热心网友
意思就是需要一个变量来存储结果才能在后续代码中使用,用js代码举例
"abc";
这个不会报错,但是后面也用不了,必须是
var a = 'abc';
然后你可以使用a
问题中的select语句也是如此,执行后的结果必须指明结果保存到哪里,然后你才能调用到哦。
热心网友
为什么要用存储过程,直接用视图就好了.
INTO 是赋值,没值,你怎么判断?