一般的多层嵌套可以用几个表联合起来查询就能替代,但有时却不能代替,比如,第二个要查询的值是第一个查出值后再进行like运算
--------------------
declare
v_0 number;
v_1 number;
cursor c1 is select productordernumber from his_productorder@pro_crm where productid in (9000045516);
cursor c2 is select cust_order_id from suf_cust_order_q_his where cust_order_num like v_0||'%';
cursor c3 is select * from suf_work_order_q_his where cust_order_id=v_1;
begin
for i in c1 loop
v_0:=i.productordernumber;
for j in c2 loop
v_1:=j.cust_order_id;
for k in c3 loop
dbms_output.put_line(k.work_order_id||' '||k.status);
end loop;
end loop;
end loop;