欢迎来到Doc100.Net免费学习资源知识分享平台!
您的位置:首页 > 程序异常 >

informix存储过程的有关问题

更新时间: 2014-01-05 02:20:19 责任编辑: Author_N1

 

informix存储过程的问题
create procedure update_hme_tel()
define ccd_act char(18);
define hme_tel char(20);

declare c1 cursor 
select ccd_act, hme_tel from act_hme_tel;
open c1
fetch next from c1 into ccd_act, hme_tel

select ccd_act, hme_tel into ccd_act, hme_tel from act_hme_tel;
update t_cc_ccd_cust set hme_tel= hme_tel
where ccd_act = ccd_act;

end procedure;

报201错误

--参考方法--
你把4gl和SP搞混了。
--参考方法--
供参考:
create procedure P_DealBankers()
RETURNING CHAR(255), CHAR(255);
DEFINE s_RespMsg CHAR(255);
DEFINE s_RespData CHAR(255);

DEFINE iSqlCode INTEGER;

DEFINE s_EntNo CHAR(10);
DEFINE s_TrDate CHAR(8);
DEFINE l_Serial INTEGER;

DEFINE s_DActNo CHAR(30);
DEFINE s_DCusName CHAR(60);
DEFINE s_DOpenBank CHAR(10);
DEFINE s_DBankName CHAR(60);
DEFINE s_CActNo CHAR(30);
DEFINE s_CCusName CHAR(60);
DEFINE s_COpenBank CHAR(10);
DEFINE s_CBankName CHAR(60);

LET iSqlCode = 0;
LET s_RespData = '';

LET s_EntNo = '';
LET s_TrDate = '';
LEt l_Serial = 0;

LET s_DActNo = '';
LET s_DCusName = '';
LET s_DOpenBank = '';
LET s_DBankName = '';
LET s_CActNo = '';
LET s_CCusName = '';
LET s_COpenBank = '';
LET s_CBankName = '';

FOREACH SELECT fc_DActNo, fc_CActNo, fc_TrDate, fi_Serial, fc_EntNo
INTO s_DActNo, s_CActNo, s_TrDate, l_Serial, s_EntNo
FROM TCAcctLst
WHERE fc_Flag = '1'

-- tcbtcustact无101账户
IF (s_DActNo[1,3] = '101' OR s_CActNo[1,3] = '101') THEN
CONTINUE FOREACH;
END If

SELECT DISTINCT A.fc_bankno, A.fc_cusname, B.fc_bankName
INTO s_DOpenBank, s_DCusName, s_DBankName
FROM tcbtcustact A, OUTER Tbanklst B
WHERE A.fc_newact = s_DActNo
AND A.fc_bankno = B.fc_bankNo;
let iSqlCode = DBINFO('sqlca.sqlerrd2');
IF (iSqlCode = 0) THEN
CONTINUE FOREACH;
END IF

UPDATE TCAcctLst
SET fc_dcusname = s_DCusName,
fc_dopenbank = s_DOpenBank,
fc_dbankname = s_DBankName,
fc_ccusname = s_CCusName,
fc_copenbank = s_COpenBank,
fc_cbankname = s_CBankName
WHERE fc_trdate = s_TrDate
AND fi_Serial = l_Serial
AND fc_entno = s_EntNo
AND fc_dactno = s_DActNo
AND fc_cactno = s_CActNo
;

END FOREACH

LET s_RespMsg='Response=00000|';
RETURN s_RespMsg, s_RespData;

END PROCEDURE;

--参考方法--
declare c1 cursor
select ccd_act, hme_tel from act_hme_tel;
open c1
fetch next from c1 into ccd_act, hme_tel

这个是什么语法啊?
--参考方法--
SQL code

create procedure update_hme_tel()
define ccd_act char(18);
define hme_tel char(20);

foreach 
select ccd_act, hme_tel into ccd_act ,hme_tel  from act_hme_tel

update t_cc_ccd_cust set hme_tel= hme_tel
where ccd_act = ccd_act;
end foreach;

end procedure; 			
			
		
上一篇:上一篇
下一篇:下一篇

 

随机推荐程序问答结果

 

 

如对文章有任何疑问请提交到问题反馈,或者您对内容不满意,请您反馈给我们DOC100.NET论坛发贴求解。
DOC100.NET资源网,机器学习分类整理更新日期::2014-01-05 02:20:19
如需转载,请注明文章出处和来源网址:http://www.doc100.net/bugs/t/8626/
本文WWW.DOC100.NET DOC100.NET版权所有。