1404: into ret
1405: from dual
1406: where exists (
1407: select 1
1408: from hz_cust_accounts hca, hz_parties hp,
1409: mtl_reservations mr, oe_order_lines_all ool
1410: where mr.demand_source_line_id = ool.line_id
1411: and mr.demand_source_type_id = 2
1412: and mr.supply_source_type_id = 5
1478: if ( cust_cnt >0 ) then -- so_cnt should >0 too
1479: select mso.segment1, hp.party_name
1480: into so_name, cust_name
1481: from mtl_reservations mr, oe_order_lines_all ool,
1482: hz_cust_accounts hca, hz_parties hp,
1483: mtl_sales_orders mso
1484: where mr.demand_source_line_id = ool.line_id
1485: and mr.demand_source_type_id = 2
1486: and mr.supply_source_type_id = 5