1911: SELECT 'Open return for this sales order'
1912: /*MOAC*/
1913: --FROM oe_order_lines sl1,
1914: --oe_order_lines sl2,
1915: FROM oe_order_lines_all sl1,
1916: oe_order_lines_all sl2,
1917: oe_order_headers_all sh,
1918: oe_order_types_v ot --MOAC view based on multiple objects
1919: WHERE sh.order_number = p_order_number
1912: /*MOAC*/
1913: --FROM oe_order_lines sl1,
1914: --oe_order_lines sl2,
1915: FROM oe_order_lines_all sl1,
1916: oe_order_lines_all sl2,
1917: oe_order_headers_all sh,
1918: oe_order_types_v ot --MOAC view based on multiple objects
1919: WHERE sh.order_number = p_order_number
1920: AND sh.order_type_id = ot.order_type_id
2169:
2170: CURSOR c_lock_audit_hist_ent2 IS
2171: SELECT entity_id -- Lock all rows to be purged
2172: FROM OE_AUDIT_ATTR_HISTORY
2173: WHERE (entity_id,entity_number) IN (SELECT 2,line_id FROM oe_order_lines_all WHERE header_id=p_header_id)
2174: FOR UPDATE NOWAIT;
2175:
2176: CURSOR c_lock_audit_hist_ent6_8 IS
2177: SELECT entity_id -- Lock all rows to be purged
2210: OPEN c_lock_audit_hist_ent2;
2211: CLOSE c_lock_audit_hist_ent2;
2212: DELETE
2213: FROM OE_AUDIT_ATTR_HISTORY
2214: WHERE (entity_id,entity_number) IN (SELECT 2,line_id FROM oe_order_lines_all WHERE header_id=p_header_id);
2215:
2216:
2217: OPEN c_lock_audit_hist_ent6_8;
2218: CLOSE c_lock_audit_hist_ent6_8;