Thursday, October 8, 2015

Order Holds Query in Oracle Applications



SELECT h.order_number, l.line_id, hs.hold_comment, ho.name hold_name
  FROM oe_order_holds_all oh,
       oe_order_lines_all l,
       oe_order_headers_all h,
       oe_hold_definitions ho,
       oe_hold_sources_all hs
 WHERE     oh.header_id = h.header_id
       AND (h.cancelled_flag IS NULL OR h.cancelled_flag = 'N')
       AND h.open_flag = 'Y'
       AND oh.hold_source_id = hs.hold_source_id
       AND hs.hold_id = ho.hold_id
       AND h.header_id = l.header_id
       AND l.open_flag = 'Y'
       AND l.line_id = NVL (oh.line_id, l.line_id)
       AND oh.hold_release_id IS NULL

No comments:

Post a Comment