oralce存储过程怎么用loop进行双重循环呀
openballast_speed;openladen_speed;loopfetchballast_speedintov_ballast_speed_record;ex...
open ballast_speed;
open laden_speed;
loop
fetch ballast_speed
into v_ballast_speed_record;
exit when ballast_speed%notfound;
loop
fetch laden_speed
into v_laden_speed_record;
exit when laden_speed%notfound;
dbms_output.put_line(v_ballast_speed_record.speed || v_ballast_speed_record.fuel_consumption||v_laden_speed_record.speed ||v_laden_speed_record.fuel_consumption);
end loop;
end loop;
怎么我这个loop循环不了啊,第一个游标有八条,第二个游标有8条,按理说有64条记录才对,但是我的这个双重循环只能显示8条,结果是在外层循环里,跑了一次,就不往下走了。。大侠怎么解决。。。 展开
open laden_speed;
loop
fetch ballast_speed
into v_ballast_speed_record;
exit when ballast_speed%notfound;
loop
fetch laden_speed
into v_laden_speed_record;
exit when laden_speed%notfound;
dbms_output.put_line(v_ballast_speed_record.speed || v_ballast_speed_record.fuel_consumption||v_laden_speed_record.speed ||v_laden_speed_record.fuel_consumption);
end loop;
end loop;
怎么我这个loop循环不了啊,第一个游标有八条,第二个游标有8条,按理说有64条记录才对,但是我的这个双重循环只能显示8条,结果是在外层循环里,跑了一次,就不往下走了。。大侠怎么解决。。。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询