The following lines contain the word 'select', 'insert', 'update' or 'delete':
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** In Procedure: chord_dist ***' );
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** Finish: chord_dist ***' );
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** In procedure: check_dist_change ***' );
SELECT DISTINCT 'Y'
INTO x_dist_control.distribution_num
FROM PO_DISTRIBUTIONS_ALL POD,
PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
WHERE POD.po_header_id = x_po_header_id
AND POD.po_distribution_id = PODA.po_distribution_id (+)
AND PODA.latest_external_flag (+) = 'Y'
AND (
(PODA.po_distribution_id is NULL)
OR (POD.distribution_num <> PODA.distribution_num)
OR (POD.distribution_num IS NULL
AND PODA.distribution_num IS NOT NULL)
OR (POD.distribution_num IS NOT NULL
AND PODA.distribution_num IS NULL)
)
--
AND POD.distribution_type <> 'AGREEMENT';
SELECT DISTINCT 'Y'
INTO x_dist_control.distribution_num
FROM PO_DISTRIBUTIONS_ALL POD,
PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
WHERE POD.po_release_id = x_po_release_id
AND POD.po_distribution_id = PODA.po_distribution_id (+)
AND PODA.latest_external_flag (+) = 'Y'
AND (
(PODA.po_distribution_id is NULL)
OR (POD.distribution_num <> PODA.distribution_num)
OR (POD.distribution_num IS NULL
AND PODA.distribution_num IS NOT NULL)
OR (POD.distribution_num IS NOT NULL
AND PODA.distribution_num IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_dist_control.deliver_to_person_id
FROM PO_DISTRIBUTIONS_ALL POD,
PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
WHERE
POD.po_header_id = x_po_header_id
AND POD.po_distribution_id = PODA.po_distribution_id (+)
AND PODA.latest_external_flag (+) = 'Y'
AND (
(PODA.po_distribution_id is NULL)
OR (POD.deliver_to_person_id <> PODA.deliver_to_person_id)
OR (POD.deliver_to_person_id IS NULL
AND PODA.deliver_to_person_id IS NOT NULL)
OR (POD.deliver_to_person_id IS NOT NULL
AND PODA.deliver_to_person_id IS NULL)
)
--
AND POD.distribution_type <> 'AGREEMENT';
SELECT DISTINCT 'Y'
INTO x_dist_control.deliver_to_person_id
FROM PO_DISTRIBUTIONS_ALL POD,
PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
WHERE
POD.po_release_id = x_po_release_id
AND POD.po_distribution_id = PODA.po_distribution_id (+)
AND PODA.latest_external_flag (+) = 'Y'
AND (
(PODA.po_distribution_id is NULL)
OR (POD.deliver_to_person_id <> PODA.deliver_to_person_id)
OR (POD.deliver_to_person_id IS NULL
AND PODA.deliver_to_person_id IS NOT NULL)
OR (POD.deliver_to_person_id IS NOT NULL
AND PODA.deliver_to_person_id IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_dist_control.rate_date
FROM PO_DISTRIBUTIONS_ALL POD,
PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
WHERE
POD.po_header_id = x_po_header_id
AND POD.po_distribution_id = PODA.po_distribution_id (+)
AND PODA.latest_external_flag (+) = 'Y'
AND (
(PODA.po_distribution_id is NULL)
OR (POD.rate_date <> PODA.rate_date)
OR (POD.rate_date IS NULL
AND PODA.rate_date IS NOT NULL)
OR (POD.rate_date IS NOT NULL
AND PODA.rate_date IS NULL)
)
--
AND POD.distribution_type <> 'AGREEMENT';
SELECT DISTINCT 'Y'
INTO x_dist_control.rate_date
FROM PO_DISTRIBUTIONS_ALL POD,
PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
WHERE
POD.po_release_id = x_po_release_id
AND POD.po_distribution_id = PODA.po_distribution_id (+)
AND PODA.latest_external_flag (+) = 'Y'
AND (
(PODA.po_distribution_id is NULL)
OR (POD.rate_date <> PODA.rate_date)
OR (POD.rate_date IS NULL
AND PODA.rate_date IS NOT NULL)
OR (POD.rate_date IS NOT NULL
AND PODA.rate_date IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_dist_control.gl_encumbered_date
FROM PO_DISTRIBUTIONS_ALL POD,
PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
WHERE
POD.po_header_id = x_po_header_id
AND POD.po_distribution_id = PODA.po_distribution_id (+)
AND PODA.latest_external_flag (+) = 'Y'
AND (
(PODA.po_distribution_id is NULL)
OR (POD.gl_encumbered_date <> PODA.gl_encumbered_date)
OR (POD.gl_encumbered_date IS NULL
AND PODA.gl_encumbered_date IS NOT NULL)
OR (POD.gl_encumbered_date IS NOT NULL
AND PODA.gl_encumbered_date IS NULL)
)
--
AND POD.distribution_type <> 'AGREEMENT';
SELECT DISTINCT 'Y'
INTO x_dist_control.gl_encumbered_date
FROM PO_DISTRIBUTIONS_ALL POD,
PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
WHERE
POD.po_release_id = x_po_release_id
AND POD.po_distribution_id = PODA.po_distribution_id (+)
AND PODA.latest_external_flag (+) = 'Y'
AND (
(PODA.po_distribution_id is NULL)
OR (POD.gl_encumbered_date <> PODA.gl_encumbered_date)
OR (POD.gl_encumbered_date IS NULL
AND PODA.gl_encumbered_date IS NOT NULL)
OR (POD.gl_encumbered_date IS NOT NULL
AND PODA.gl_encumbered_date IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_dist_control.code_combination_id
FROM PO_DISTRIBUTIONS_ALL POD,
PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
WHERE POD.po_header_id = x_po_header_id
AND POD.po_distribution_id = PODA.po_distribution_id (+)
AND PODA.latest_external_flag (+) = 'Y'
AND (
(PODA.po_distribution_id is NULL)
OR (POD.code_combination_id <> PODA.code_combination_id)
OR (POD.code_combination_id IS NULL
AND PODA.code_combination_id IS NOT NULL)
OR (POD.code_combination_id IS NOT NULL
AND PODA.code_combination_id IS NULL)
)
--
AND POD.distribution_type <> 'AGREEMENT';
SELECT DISTINCT 'Y'
INTO x_dist_control.code_combination_id
FROM PO_DISTRIBUTIONS_ALL POD,
PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
WHERE
POD.po_release_id = x_po_release_id
AND POD.po_distribution_id = PODA.po_distribution_id (+)
AND PODA.latest_external_flag (+) = 'Y'
AND (
(PODA.po_distribution_id is NULL)
OR (POD.code_combination_id <> PODA.code_combination_id)
OR (POD.code_combination_id IS NULL
AND PODA.code_combination_id IS NOT NULL)
OR (POD.code_combination_id IS NOT NULL
AND PODA.code_combination_id IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_dist_control.destination_subinventory
FROM PO_DISTRIBUTIONS_ALL POD,
PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
WHERE
POD.po_header_id = x_po_header_id
AND POD.po_distribution_id = PODA.po_distribution_id (+)
AND PODA.latest_external_flag (+) = 'Y'
AND (
(PODA.po_distribution_id is NULL)
OR (POD.destination_subinventory <> PODA.destination_subinventory)
OR (POD.destination_subinventory IS NULL
AND PODA.destination_subinventory IS NOT NULL)
OR (POD.destination_subinventory IS NOT NULL
AND PODA.destination_subinventory IS NULL)
)
--
AND POD.distribution_type <> 'AGREEMENT';
SELECT DISTINCT 'Y'
INTO x_dist_control.destination_subinventory
FROM PO_DISTRIBUTIONS_ALL POD,
PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
WHERE
POD.po_release_id = x_po_release_id
AND POD.po_distribution_id = PODA.po_distribution_id (+)
AND PODA.latest_external_flag (+) = 'Y'
AND (
(PODA.po_distribution_id is NULL)
OR (POD.destination_subinventory <> PODA.destination_subinventory)
OR (POD.destination_subinventory IS NULL
AND PODA.destination_subinventory IS NOT NULL)
OR (POD.destination_subinventory IS NOT NULL
AND PODA.destination_subinventory IS NULL)
);
SELECT max(po_chord_wf0.percentage_change(
PODA.quantity_ordered, POD.quantity_ordered))
INTO x_dist_control.quantity_ordered_change
FROM PO_DISTRIBUTIONS_ALL POD,
PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
WHERE
POD.po_header_id = x_po_header_id
AND POD.po_distribution_id = PODA.po_distribution_id (+)
AND PODA.latest_external_flag (+) = 'Y'
--
AND POD.distribution_type <> 'AGREEMENT';
SELECT max(po_chord_wf0.percentage_change(
PODA.quantity_ordered, POD.quantity_ordered))
INTO x_dist_control.quantity_ordered_change
FROM PO_DISTRIBUTIONS_ALL POD,
PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
WHERE
POD.po_release_id = x_po_release_id
AND POD.po_distribution_id = PODA.po_distribution_id (+)
AND PODA.latest_external_flag (+) = 'Y';
SELECT max(po_chord_wf0.percentage_change(
PODA.rate, POD.rate))
INTO x_dist_control.rate_change
FROM PO_DISTRIBUTIONS_ALL POD,
PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
WHERE
POD.po_header_id = x_po_header_id
AND POD.po_distribution_id = PODA.po_distribution_id (+)
AND PODA.latest_external_flag (+) = 'Y'
--
AND POD.distribution_type <> 'AGREEMENT';
SELECT max(po_chord_wf0.percentage_change(
PODA.rate, POD.rate))
INTO x_dist_control.rate_change
FROM PO_DISTRIBUTIONS_ALL POD,
PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
WHERE
POD.po_release_id = x_po_release_id
AND POD.po_distribution_id = PODA.po_distribution_id (+)
AND PODA.latest_external_flag (+) = 'Y';
SELECT poh.currency_code
INTO l_currency_code
FROM po_headers_all poh
WHERE poh.po_header_id = x_po_header_id;
SELECT max(po_chord_wf0.percentage_change(
round (
decode(POLLA.value_basis, 'RATE',PODA.amount_ordered,'FIXED PRICE', PODA.amount_ordered,
(PODA.quantity_ordered*POLLA.price_override))/ l_min_acct_unit )* l_min_acct_unit ,
round (
decode(POLL.value_basis, 'RATE',POD.amount_ordered,'FIXED PRICE', POD.amount_ordered,
(POD.quantity_ordered*POLL.price_override)) / l_min_acct_unit )* l_min_acct_unit
))
INTO x_dist_control.amount_ordered_change
FROM PO_DISTRIBUTIONS_ALL POD,
PO_DISTRIBUTIONS_ARCHIVE_ALL PODA,
PO_LINE_LOCATIONS_ALL POLL,
PO_LINE_LOCATIONS_ARCHIVE_ALL POLLA
WHERE POD.po_header_id = x_po_header_id
AND POD.po_distribution_id = PODA.po_distribution_id (+)
AND PODA.latest_external_flag (+) = 'Y'
AND POD.distribution_type <> 'AGREEMENT'
AND POD.line_location_id = POLL.line_location_id -- Bug 5071741
AND PODA.line_location_id = POLLA.line_location_id -- Bug 5071741
AND POLL.line_location_id = POLLA.line_location_id (+) -- Bug 5071741
AND POLLA.latest_external_flag (+) = 'Y' -- Bug 5071741
AND POLL.po_release_id is NULL; -- Bug 5071741
SELECT max(po_chord_wf0.percentage_change(
round (
decode(POLLA.value_basis, 'RATE',PODA.amount_ordered,'FIXED PRICE', PODA.amount_ordered,
(PODA.quantity_ordered*POLLA.price_override)), l_precision ) ,
round (
decode(POLL.value_basis, 'RATE',POD.amount_ordered,'FIXED PRICE', POD.amount_ordered,
(POD.quantity_ordered*POLL.price_override)) , l_precision )
))
INTO x_dist_control.amount_ordered_change
FROM PO_DISTRIBUTIONS_ALL POD,
PO_DISTRIBUTIONS_ARCHIVE_ALL PODA,
PO_LINE_LOCATIONS_ALL POLL,
PO_LINE_LOCATIONS_ARCHIVE_ALL POLLA
WHERE POD.po_header_id = x_po_header_id
AND POD.po_distribution_id = PODA.po_distribution_id (+)
AND PODA.latest_external_flag (+) = 'Y'
AND POD.distribution_type <> 'AGREEMENT'
AND POD.line_location_id = POLL.line_location_id -- Bug 5071741
AND PODA.line_location_id = POLLA.line_location_id -- Bug 5071741
AND POLL.line_location_id = POLLA.line_location_id (+) -- Bug 5071741
AND POLLA.latest_external_flag (+) = 'Y' -- Bug 5071741
AND POLL.po_release_id is NULL; -- Bug 5071741
SELECT poh.currency_code
INTO l_currency_code
FROM po_releases_all por,
po_headers_all poh
WHERE por.po_release_id = x_po_release_id
AND poh.po_header_id = por.po_header_id;
SELECT max(po_chord_wf0.percentage_change(
round (
decode(POLLA.value_basis,'FIXED PRICE', PODA.amount_ordered,
(PODA.quantity_ordered*POLLA.price_override))/ l_min_acct_unit )* l_min_acct_unit ,
round (
decode(POLL.value_basis, 'FIXED PRICE', POD.amount_ordered,
(POD.quantity_ordered*POLL.price_override)) / l_min_acct_unit )* l_min_acct_unit
))
INTO x_dist_control.amount_ordered_change
FROM PO_DISTRIBUTIONS_ALL POD,
PO_DISTRIBUTIONS_ARCHIVE_ALL PODA,
PO_LINE_LOCATIONS_ALL POLL,
PO_LINE_LOCATIONS_ARCHIVE_ALL POLLA
WHERE POD.po_release_id = x_po_release_id
AND POD.po_distribution_id = PODA.po_distribution_id (+)
AND PODA.latest_external_flag (+) = 'Y'
AND POD.line_location_id = POLL.line_location_id -- Bug 5071741
AND PODA.line_location_id = POLLA.line_location_id -- Bug 5071741
AND POLL.line_location_id = POLLA.line_location_id (+) -- Bug 5071741
AND POLLA.latest_external_flag (+) = 'Y'; -- Bug 5071741
SELECT max(po_chord_wf0.percentage_change(
round (
decode(POLLA.value_basis,'FIXED PRICE', PODA.amount_ordered,
(PODA.quantity_ordered*POLLA.price_override)) , l_precision ) ,
round (
decode(POLL.value_basis, 'FIXED PRICE', POD.amount_ordered,
(POD.quantity_ordered*POLL.price_override)) , l_precision )
))
INTO x_dist_control.amount_ordered_change
FROM PO_DISTRIBUTIONS_ALL POD,
PO_DISTRIBUTIONS_ARCHIVE_ALL PODA,
PO_LINE_LOCATIONS_ALL POLL,
PO_LINE_LOCATIONS_ARCHIVE_ALL POLLA
WHERE POD.po_release_id = x_po_release_id
AND POD.po_distribution_id = PODA.po_distribution_id (+)
AND PODA.latest_external_flag (+) = 'Y'
AND POD.line_location_id = POLL.line_location_id -- Bug 5071741
AND PODA.line_location_id = POLLA.line_location_id -- Bug 5071741
AND POLL.line_location_id = POLLA.line_location_id (+) -- Bug 5071741
AND POLLA.latest_external_flag (+) = 'Y'; -- Bug 5071741
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** Finish: check_dist_change ***' );
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** exception check_dist_change ***');
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** exeption: check_dist_change ***');
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** In Procedure:set_wf_dist_control ***' );
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** Finish:set_wf_dist_control ***' );
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** exeption: set_wf_dist_control ***');
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** In Procedure :get_wf_dist_control ***' );
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** Finished: get_wf_dist_control ***' );
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** In procedure get_wf_dist_parameters ***');
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'po_header_id = ' || to_char(x_dist_parameters.po_header_id));
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'po_release_id = '|| to_char(x_dist_parameters.po_release_id));
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** FINISH: get_wf_dist_parameters ***');
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'***set_wf_dist_parameters exception e_invalid_setup *** ');
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'***set_wf_dist_parameters exception *** ');
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** In Procedure: debug_dist_control ***' );
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'distribution_num : '|| x_dist_control.distribution_num);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'deliver_to_person_id : '|| x_dist_control.deliver_to_person_id);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'rate_date : '|| x_dist_control.rate_date);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'gl_encumbered_date : '|| x_dist_control.gl_encumbered_date);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'code_combination_id : '|| x_dist_control.code_combination_id);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'destination_subinventory : '|| x_dist_control.destination_subinventory);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'quantity_ordered_change : '|| to_char(x_dist_control.quantity_ordered_change));
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'amount_ordered_change : '|| to_char(x_dist_control.amount_ordered_change)); --
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** Finished: debug_dist_control **' );