create or replace procedure pro(recorddate in varchar2,p out number) is
cursor price is select pri from tp_airline_month where year||month=recorddate;
p:=1;
begin
for sin in price loop
p:=p*sin.pri;
end loop;
end pro;
------解决思路----------------------
CREATE OR REPLACE PROCEDURE PRO(RECORDDATE IN VARCHAR2, P OUT NUMBER) IS
CURSOR PRICE IS
SELECT PRI FROM TP_AIRLINE_MONTH WHERE YEAR
------解决思路----------------------
MONTH = RECORDDATE;
BEGIN
P := 1;--err
FOR SIN IN PRICE LOOP
P := P * SIN.PRI;
END LOOP;
END PRO;
------解决思路----------------------
定义一个变量代替输出变量p的使用,最后return 定义的变量
------解决思路----------------------
报什么错?
------解决思路----------------------
你最好是把你的错误贴出来,别人没有你的环境很难找错。
很怀疑是不是你cursor有问题
SELECT PRI FROM TP_AIRLINE_MONTH WHERE YEAR
------解决思路----------------------
MONTH = RECORDDATE;