The following lines contain the word 'select', 'insert', 'update' or 'delete':
PO_WF_DEBUG_PKG.insert_debug(ITEMTYPE, ITEMKEY,
'*** In Procedure: chord_release ***' );
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** Finish: chord_release ***' );
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** In Procedure check_release_change ***');
SELECT DISTINCT 'Y'
INTO x_release_control.agent_id
FROM PO_RELEASES_all POR,
PO_RELEASES_ARCHIVE_all PORA
WHERE POR.po_release_id = x_po_release_id
AND POR.po_release_id = PORA.po_release_id
AND PORA.latest_external_flag (+) = 'Y'
AND (
(PORA.po_release_id IS NULL)
OR (POR.agent_id <> PORA.agent_id)
OR (POR.agent_id IS NULL
AND PORA.agent_id IS NOT NULL)
OR (POR.agent_id IS NOT NULL
AND PORA.agent_id IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_release_control.acceptance_required_flag
FROM PO_RELEASES_all POR,
PO_RELEASES_ARCHIVE_all PORA
WHERE POR.po_release_id = x_po_release_id
AND POR.po_release_id = PORA.po_release_id
AND PORA.latest_external_flag (+) = 'Y'
AND (
(PORA.po_release_id IS NULL)
OR (POR.acceptance_required_flag <> PORA.acceptance_required_flag)
OR (POR.acceptance_required_flag IS NULL
AND PORA.acceptance_required_flag IS NOT NULL)
OR (POR.acceptance_required_flag IS NOT NULL
AND PORA.acceptance_required_flag IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_release_control.acceptance_due_date
FROM PO_RELEASES_all POR,
PO_RELEASES_ARCHIVE_all PORA
WHERE POR.po_release_id = x_po_release_id
AND POR.po_release_id = PORA.po_release_id
AND PORA.latest_external_flag (+) = 'Y'
AND (
(PORA.po_release_id IS NULL)
OR (POR.acceptance_due_date <> PORA.acceptance_due_date)
OR (POR.acceptance_due_date IS NULL
AND PORA.acceptance_due_date IS NOT NULL)
OR (POR.acceptance_due_date IS NOT NULL
AND PORA.acceptance_due_date IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_release_control.release_num
FROM PO_RELEASES_all POR,
PO_RELEASES_ARCHIVE_all PORA
WHERE POR.po_release_id = x_po_release_id
AND POR.po_release_id = PORA.po_release_id
AND PORA.latest_external_flag (+) = 'Y'
AND (
(PORA.po_release_id IS NULL)
OR (POR.release_num <> PORA.release_num)
OR (POR.release_num IS NULL
AND PORA.release_num IS NOT NULL)
OR (POR.release_num IS NOT NULL
AND PORA.release_num IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_release_control.release_date
FROM PO_RELEASES_all POR,
PO_RELEASES_ARCHIVE_all PORA
WHERE POR.po_release_id = x_po_release_id
AND POR.po_release_id = PORA.po_release_id
AND PORA.latest_external_flag (+) = 'Y'
AND (
(PORA.po_release_id IS NULL)
OR (POR.release_date <> PORA.release_date)
OR (POR.release_date IS NULL
AND PORA.release_date IS NOT NULL)
OR (POR.release_date IS NOT NULL
AND PORA.release_date IS NULL)
);
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** Finish check_release_change ***');
SELECT po_header_id
into x_po_header_id
FROM po_releases_all PR
WHERE PR.po_release_id = x_po_release_id;
SELECT nvl(round( round(sum((nvl(POD.quantity_ordered, 0) -
nvl(POD.quantity_cancelled, 0)) *
nvl(POLL.price_override, 0) * nvl(POD.rate,1) /
nvl(X_min_unit,1))) * nvl(X_min_unit,1) /
nvl(X_base_min_unit,1))
* nvl(X_base_min_unit,1) , 0)
INTO x_release_total
FROM PO_DISTRIBUTIONS_ALL POD, PO_LINE_LOCATIONS_ALL POLL
WHERE POLL.po_release_id = x_po_release_id
AND POLL.shipment_type in ('SCHEDULED','BLANKET')
AND POLL.line_location_id = POD.line_location_id;
SELECT nvl(round( round(sum((nvl(PODA.quantity_ordered, 0) -
nvl(PODA.quantity_cancelled, 0)) *
nvl(POLLA.price_override, 0) * nvl(PODA.rate,1) /
nvl(X_min_unit,1))) * nvl(X_min_unit,1) /
nvl(X_base_min_unit,1))
* nvl(X_base_min_unit,1) , 0)
INTO x_release_total_archive
FROM PO_LINE_LOCATIONS_ARCHIVE_ALL POLLA,
PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
WHERE PODA.po_header_id = (SELECT po_header_id
FROM po_releases
WHERE po_release_id = x_po_release_id)
AND POLLA.po_header_id = PODA.po_header_id
AND POLLA.po_release_id = x_po_release_id
AND POLLA.latest_external_flag (+) = 'Y'
AND PODA.latest_external_flag (+) = 'Y'
AND POLLA.shipment_type in ('SCHEDULED','BLANKET')
AND POLLA.line_location_id = PODA.line_location_id;
SELECT sum(
(nvl(POD.quantity_ordered, 0) -
nvl(POD.quantity_cancelled, 0)) *
nvl(POLL.price_override, 0))
INTO x_release_total
FROM PO_DISTRIBUTIONS_ALL POD, PO_LINE_LOCATIONS_ALL POLL
WHERE POLL.po_release_id = x_po_release_id
AND POLL.shipment_type in ('SCHEDULED','BLANKET')
AND POLL.line_location_id = POD.line_location_id;
SELECT sum(
(nvl(PODA.quantity_ordered, 0) -
nvl(PODA.quantity_cancelled, 0)) *
nvl(POLLA.price_override, 0))
INTO x_release_total_archive
FROM PO_LINE_LOCATIONS_ARCHIVE_ALL POLLA,
PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
WHERE PODA.po_header_id = (SELECT po_header_id
FROM po_releases
WHERE po_release_id = x_po_release_id)
AND POLLA.po_header_id = PODA.po_header_id
AND POLLA.po_release_id = x_po_release_id
AND POLLA.latest_external_flag (+) = 'Y'
AND PODA.latest_external_flag (+) = 'Y'
AND POLLA.shipment_type in ('SCHEDULED','BLANKET')
AND POLLA.line_location_id = PODA.line_location_id;
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY, '*** In procedure set_wf_release_control ***');
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** Finish set_wf_release_control ***');
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** In procedure get_wf_release_control ***');
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** FINISH: get_wf_release_control ***');
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** In procedure: debug_release_control ***');
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'agent_id : ' ||x_release_control.agent_id);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'acceptance_required_flag : ' ||x_release_control.acceptance_required_flag);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'acceptance_due_date : ' ||x_release_control.acceptance_due_date);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'release_num : ' ||x_release_control.release_num);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'release_date : ' ||x_release_control.release_date);
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** Finished: debug_release_control ***');
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** In procedure get_wf_release_parameters ***');
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'po_release_id = '|| to_char(x_release_parameters.po_release_id));
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** FINISH: get_wf_release_parameters ***');