441: , count(*) num_lines
442: , NULL request_id
443: , NULL batch_id
444: , h.org_id
445: FROM oe_headers_interface h, oe_lines_iface_all l, --bug 4685432
446: oe_sys_parameters_all sys
447: WHERE h.order_source_id = nvl(p_order_source_id,h.order_source_id)
448: AND h.orig_sys_document_ref = nvl(p_orig_sys_document_ref,h.orig_sys_document_ref)
449: AND h.org_id = l.org_id
518: , count(*) num_lines
519: , NULL request_id
520: , NULL batch_id
521: , h.org_id org_id
522: FROM oe_headers_interface h, oe_lines_iface_all l, --bug 4685432
523: oe_sys_parameters_all sys
524: WHERE h.order_source_id = nvl(p_order_source_id,h.order_source_id)
525: AND h.orig_sys_document_ref = nvl(p_orig_sys_document_ref,h.orig_sys_document_ref)
526: AND sys.org_id(+) = h.org_id --bug 4685432, 5209313
788: INTO l_row_count
789: FROM(
790: SELECT /* MOAC_SQL_CHANGE */
791: h.orig_sys_document_ref orig_sys_document_ref
792: FROM oe_headers_interface h, oe_order_sources os, --bug 4685432
793: oe_sys_parameters_all sys
794: WHERE request_id IS NULL
795: AND sys.org_id(+) = h.org_id --bug 4685432, 5209313
796: AND sys.parameter_code(+) = 'ENABLE_FULFILLMENT_ACCEPTANCE'
895: -- No need to select NULL org_id records.
896: oe_debug_pub.add('p_process_recs_with_no_org =N',1);
897: SELECT /* MOAC_SQL_CHANGE */ count(*)
898: INTO l_row_count
899: FROM oe_headers_interface h, oe_order_sources os, --bug 4685432
900: oe_sys_parameters_all sys
901: WHERE request_id IS NULL
902: AND sys.org_id(+) = h.org_id --bug 4685432, 5209313
903: AND sys.parameter_code(+) = 'ENABLE_FULFILLMENT_ACCEPTANCE'