--jdt4 declare v_total number(10,2):=0; cursor c_orders is --查所有订单信息 select order_total from orders; begin for total in c_orders loop v_total:=v_total+total.order_total; end loop; if v_total<50000 then dbms_output.put_line(‘需提高订货额‘); elsif v_total>=50000 then dbms_output.put_line(‘已达到订货额‘); end if; end;
原文:https://www.cnblogs.com/wzdnwyyu/p/11119341.html