我的存储过程每次执行完毕后,sqlerrtext总是报错说:procedure has not been executed or has no results
察看sqlcode为100,但是存储过程里的语句功能已经实现了,请问这是为什么?
还有,我通过sqlplus建立的存储过程,第二天总是要重新建立,第一天建的都不见了,(我建立后马上就commit了)这是为什么?
察看sqlcode为100,但是存储过程里的语句功能已经实现了,请问这是为什么?
还有,我通过sqlplus建立的存储过程,第二天总是要重新建立,第一天建的都不见了,(我建立后马上就commit了)这是为什么?
(llvalue out varchar)
AS
lmonth varchar(4);
lldate date;
BEGIN
Delete Input;
Delete Input_Audi;
Select const_value into lmonth from const_data where to_number(const_id) = 121;
llvalue:=lmonth;
select inputdate into lldate from copydate; Insert into input(UserID,Name, userAddr, PrjID1, duanno, OrderNo,
WaterBegin, WaterEnd, WaterAvg, WaterReal,
audi, sbkj, paytype, copyid, audiid, PrintReFlag,waterprj1,add1flag,add2flag,add3flag,add4flag,add5flag,payadd1,payadd2,payadd3,payadd4,payadd5,paytotal,payup)
select a.userid, a.username, a.Meteraddr, a.priceid, a.quduanid,a.orderid,
Case When nvl( b.WaterEnd, 0 ) = 0 Then nvl( b.WaterBegin, 0 ) Else nvl( b.WaterEnd, 0 ) End,
to_char(( case When ( stopid > 0 ) Then 1 When ( stopid <= '0' ) Then 0 End ) * nvl( b.WaterEnd, 0 )),
0,
( Case When a.UserTypeid = 2 And Stopid = 0 Then a.gudingshui Else '0' End ),
to_char(to_number(a.stopid) * to_number( -1 )), c.kj, a.paytypeid, 0, 0, 0,( Case When a.UserTypeid = 2 And Stopid = 0 Then a.gudingshui Else '0' End ),
1 ,1 , 1, 0,0, 0,0,0,0,0,0,''
From tb_userinfo a LEFT OUTER JOIN zj_gyk c ON ( a.userid = c.userid ) LEFT OUTER JOIN waterpay b ON ( a.userid = b.userid AND b.year = to_char( add_months(lldate,-1 ),'yyyy' ) And b.usemonth =to_char( add_months( lldate,-1 ),'MM' ) )
Where a.delid = 0 And a.quduanid in (select duanno from copyplayhistory where uwkyear=to_char(lldate,'yyyy') and uwkmonth=to_char(lldate,'mm'));End;
我的存储过程是这样写的!有什么问题?commit是在执行完存储过程后判断sqlcode是否等于0,才提交。但是总是报procedure has not been executed or has no results
才能保证对数据进行了更新操作.
并且使用更新后的数据进行其它操作.