The following lines contain the word 'select', 'insert', 'update' or 'delete':
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** In Procedure: chord_lines ***' );
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** Finish: chord_lines ***' );
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** In Procedure: check_lines_change ***' );
SELECT DISTINCT 'Y'
INTO x_lines_control.line_num
FROM PO_LINES POL,
PO_LINES_ARCHIVE_ALL POLA
WHERE POL.po_header_id = x_po_header_id
AND POL.po_line_id = POLA.po_line_id (+)
AND POLA.latest_external_flag (+) = 'Y'
AND (
(POLA.po_line_id is NULL)
OR (POL.line_num <> POLA.line_num)
OR (POL.line_num IS NULL AND POLA.line_num IS NOT NULL)
OR (POL.line_num IS NOT NULL AND POLA.line_num IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_lines_control.item_id
FROM PO_LINES_ALL POL,
PO_LINES_ARCHIVE_ALL POLA
WHERE POL.po_header_id = x_po_header_id
AND POL.po_line_id = POLA.po_line_id (+)
AND POLA.latest_external_flag (+) = 'Y'
AND (
(POLA.po_line_id is NULL)
OR (POL.item_id <> POLA.item_id)
OR (POL.item_id IS NULL AND POLA.item_id IS NOT NULL)
OR (POL.item_id IS NOT NULL AND POLA.item_id IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_lines_control.item_revision
FROM PO_LINES_ALL POL,
PO_LINES_ARCHIVE_ALL POLA
WHERE POL.po_header_id = x_po_header_id
AND POL.po_line_id = POLA.po_line_id (+)
AND POLA.latest_external_flag (+) = 'Y'
AND (
(POLA.po_line_id is NULL)
OR (POL.item_revision <> POLA.item_revision)
OR (POL.item_revision IS NULL AND POLA.item_revision IS NOT NULL)
OR (POL.item_revision IS NOT NULL AND POLA.item_revision IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_lines_control.category_id
FROM PO_LINES_ALL POL,
PO_LINES_ARCHIVE_ALL POLA
WHERE POL.po_header_id = x_po_header_id
AND POL.po_line_id = POLA.po_line_id (+)
AND POLA.latest_external_flag (+) = 'Y'
AND (
(POLA.po_line_id is NULL)
OR (POL.category_id <> POLA.category_id)
OR (POL.category_id IS NULL AND POLA.category_id IS NOT NULL)
OR (POL.category_id IS NOT NULL AND POLA.category_id IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_lines_control.item_description
FROM PO_LINES_ALL POL,
PO_LINES_ARCHIVE_ALL POLA
WHERE POL.po_header_id = x_po_header_id
AND POL.po_line_id = POLA.po_line_id (+)
AND POLA.latest_external_flag (+) = 'Y'
AND (
(POLA.po_line_id is NULL)
OR (POL.item_description <> POLA.item_description)
OR (POL.item_description IS NULL AND POLA.item_description IS NOT NULL)
OR (POL.item_description IS NOT NULL AND POLA.item_description IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_lines_control.unit_meas_lookup_code
FROM PO_LINES_ALL POL,
PO_LINES_ARCHIVE_ALL POLA
WHERE POL.po_header_id = x_po_header_id
AND POL.po_line_id = POLA.po_line_id (+)
AND POLA.latest_external_flag (+) = 'Y'
AND (
(POLA.po_line_id is NULL)
OR (POL.unit_meas_lookup_code <> POLA.unit_meas_lookup_code)
OR (POL.unit_meas_lookup_code IS NULL AND POLA.unit_meas_lookup_code IS NOT NULL)
OR (POL.unit_meas_lookup_code IS NOT NULL AND POLA.unit_meas_lookup_code IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_lines_control.un_number_id
FROM PO_LINES_ALL POL,
PO_LINES_ARCHIVE_ALL POLA
WHERE POL.po_header_id = x_po_header_id
AND POL.po_line_id = POLA.po_line_id (+)
AND POLA.latest_external_flag (+) = 'Y'
AND (
(POLA.po_line_id is NULL)
OR (POL.un_number_id <> POLA.un_number_id)
OR (POL.un_number_id IS NULL AND POLA.un_number_id IS NOT NULL)
OR (POL.un_number_id IS NOT NULL AND POLA.un_number_id IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_lines_control.hazard_class_id
FROM PO_LINES_ALL POL,
PO_LINES_ARCHIVE_ALL POLA
WHERE POL.po_header_id = x_po_header_id
AND POL.po_line_id = POLA.po_line_id (+)
AND POLA.latest_external_flag (+) = 'Y'
AND (
(POLA.po_line_id is NULL)
OR (POL.hazard_class_id <> POLA.hazard_class_id)
OR (POL.hazard_class_id IS NULL AND POLA.hazard_class_id IS NOT NULL)
OR (POL.hazard_class_id IS NOT NULL AND POLA.hazard_class_id IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_lines_control.note_to_vendor
FROM PO_LINES_ALL POL,
PO_LINES_ARCHIVE_ALL POLA
WHERE POL.po_header_id = x_po_header_id
AND POL.po_line_id = POLA.po_line_id (+)
AND POLA.latest_external_flag (+) = 'Y'
AND (
(POLA.po_line_id is NULL)
OR (POL.note_to_vendor <> POLA.note_to_vendor)
OR (POL.note_to_vendor IS NULL AND POLA.note_to_vendor IS NOT NULL)
OR (POL.note_to_vendor IS NOT NULL AND POLA.note_to_vendor IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_lines_control.from_header_id
FROM PO_LINES_ALL POL,
PO_LINES_ARCHIVE_ALL POLA
WHERE POL.po_header_id = x_po_header_id
AND POL.po_line_id = POLA.po_line_id (+)
AND POLA.latest_external_flag (+) = 'Y'
AND (
(POLA.po_line_id is NULL)
OR (POL.from_header_id <> POLA.from_header_id)
OR (POL.from_header_id IS NULL AND POLA.from_header_id IS NOT NULL)
OR (POL.from_header_id IS NOT NULL AND POLA.from_header_id IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_lines_control.from_line_id
FROM PO_LINES_ALL POL,
PO_LINES_ARCHIVE_ALL POLA
WHERE POL.po_header_id = x_po_header_id
AND POL.po_line_id = POLA.po_line_id (+)
AND POLA.latest_external_flag (+) = 'Y'
AND (
(POLA.po_line_id is NULL)
OR (POL.from_line_id <> POLA.from_line_id)
OR (POL.from_line_id IS NULL AND POLA.from_line_id IS NOT NULL)
OR (POL.from_line_id IS NOT NULL AND POLA.from_line_id IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_lines_control.closed_code
FROM PO_LINES_ALL POL,
PO_LINES_ARCHIVE_ALL POLA
WHERE POL.po_header_id = x_po_header_id
AND POL.po_line_id = POLA.po_line_id (+)
AND POLA.latest_external_flag (+) = 'Y'
AND (
(POLA.po_line_id is NULL)
OR (POL.closed_code <> POLA.closed_code)
OR (POL.closed_code IS NULL AND POLA.closed_code IS NOT NULL)
OR (POL.closed_code IS NOT NULL AND POLA.closed_code IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_lines_control.vendor_product_num
FROM PO_LINES_ALL POL,
PO_LINES_ARCHIVE_ALL POLA
WHERE POL.po_header_id = x_po_header_id
AND POL.po_line_id = POLA.po_line_id (+)
AND POLA.latest_external_flag (+) = 'Y'
AND (
(POLA.po_line_id is NULL)
OR (POL.vendor_product_num <> POLA.vendor_product_num)
OR (POL.vendor_product_num IS NULL AND POLA.vendor_product_num IS NOT NULL)
OR (POL.vendor_product_num IS NOT NULL AND POLA.vendor_product_num IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_lines_control.contract_num
FROM PO_LINES_ALL POL,
PO_LINES_ARCHIVE_ALL POLA
WHERE POL.po_header_id = x_po_header_id
AND POL.po_line_id = POLA.po_line_id (+)
AND POLA.latest_external_flag (+) = 'Y'
AND (
(POLA.po_line_id is NULL)
OR (POL.contract_id <> POLA.contract_id)
OR (POL.contract_id IS NULL
AND POLA.contract_id IS NOT NULL)
OR (POL.contract_id IS NOT NULL
AND POLA.contract_id IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_lines_control.price_type_lookup_code
FROM PO_LINES_ALL POL,
PO_LINES_ARCHIVE_ALL POLA
WHERE POL.po_header_id = x_po_header_id
AND POL.po_line_id = POLA.po_line_id (+)
AND POLA.latest_external_flag (+) = 'Y'
AND (
(POLA.po_line_id is NULL)
OR (POL.price_type_lookup_code <> POLA.price_type_lookup_code)
OR (POL.price_type_lookup_code IS NULL AND POLA.price_type_lookup_code IS NOT NULL)
OR (POL.price_type_lookup_code IS NOT NULL AND POLA.price_type_lookup_code IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_lines_control.cancel_flag
FROM PO_LINES_ALL POL,
PO_LINES_ARCHIVE_ALL POLA
WHERE POL.po_header_id = x_po_header_id
AND POL.po_line_id = POLA.po_line_id (+)
AND POLA.latest_external_flag (+) = 'Y'
AND (
(POLA.po_line_id is NULL)
OR (POL.cancel_flag <> POLA.cancel_flag)
OR (POL.cancel_flag IS NULL AND POLA.cancel_flag IS NOT NULL)
OR (POL.cancel_flag IS NOT NULL AND POLA.cancel_flag IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_lines_control.retainage_rate
FROM po_lines_all pol,
po_lines_archive_all pola
WHERE pol.po_header_id = x_po_header_id
AND pol.po_line_id = pola.po_line_id (+)
AND pola.latest_external_flag (+) = 'Y'
AND (
(pola.po_line_id IS NULL)
OR (pol.retainage_rate <> pola.retainage_rate)
OR (pol.retainage_rate IS NULL AND pola.retainage_rate IS NOT NULL)
OR (pol.retainage_rate IS NOT NULL AND pola.retainage_rate IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_lines_control.max_retainage_amount
FROM po_lines_all pol,
po_lines_archive_all pola
WHERE pol.po_header_id = x_po_header_id
AND pol.po_line_id = pola.po_line_id (+)
AND pola.latest_external_flag (+) = 'Y'
AND (
(pola.po_line_id IS NULL)
OR (pol.max_retainage_amount <> pola.max_retainage_amount)
OR (pol.max_retainage_amount IS NULL AND pola.max_retainage_amount IS NOT NULL)
OR (pol.max_retainage_amount IS NOT NULL AND pola.max_retainage_amount IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_lines_control.progress_payment_rate
FROM po_lines_all pol,
po_lines_archive_all pola
WHERE pol.po_header_id = x_po_header_id
AND pol.po_line_id = pola.po_line_id (+)
AND pola.latest_external_flag (+) = 'Y'
AND (
(pola.po_line_id IS NULL)
OR (pol.progress_payment_rate <> pola.progress_payment_rate)
OR (pol.progress_payment_rate IS NULL AND
pola.progress_payment_rate IS NOT NULL)
OR (pol.progress_payment_rate IS NOT NULL AND
pola.progress_payment_rate IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_lines_control.recoupment_rate
FROM po_lines_all pol,
po_lines_archive_all pola
WHERE pol.po_header_id = x_po_header_id
AND pol.po_line_id = pola.po_line_id (+)
AND pola.latest_external_flag (+) = 'Y'
AND (
(pola.po_line_id IS NULL)
OR (pol.recoupment_rate <> pola.recoupment_rate)
OR (pol.recoupment_rate IS NULL AND pola.recoupment_rate IS NOT NULL)
OR (pol.recoupment_rate IS NOT NULL AND pola.recoupment_rate IS NULL)
);
SELECT DISTINCT 'Y'
INTO x_lines_control.advance_amount
FROM po_line_locations_all poll,
po_line_locations_archive_all polla
WHERE poll.po_header_id = x_po_header_id
AND poll.payment_type = 'ADVANCE'
AND poll.line_location_id = polla.line_location_id (+)
AND polla.latest_external_flag (+) = 'Y'
AND (
(polla.line_location_id IS NULL)
OR (poll.amount <> polla.amount)
OR (poll.amount IS NULL AND polla.amount IS NOT NULL)
OR (poll.amount IS NOT NULL AND polla.amount IS NULL)
);
SELECT max(po_chord_wf0.percentage_change(
POLA.quantity, POL.quantity))
INTO x_lines_control.quantity_change
FROM PO_LINES_ALL POL,
PO_LINES_ARCHIVE_ALL POLA
WHERE POL.po_header_id = x_po_header_id
AND POL.po_line_id = POLA.po_line_id (+)
AND POLA.latest_external_flag (+) = 'Y';
SELECT max(po_chord_wf0.percentage_change(
POLA.unit_price, POL.unit_price))
INTO x_lines_control.unit_price_change
FROM PO_LINES_ALL POL,
PO_LINES_ARCHIVE_ALL POLA
WHERE POL.po_header_id = x_po_header_id
AND POL.po_line_id = POLA.po_line_id (+)
AND POLA.latest_external_flag (+) = 'Y';
SELECT max(po_chord_wf0.percentage_change(
POLA.not_to_exceed_price, POL.not_to_exceed_price))
INTO x_lines_control.not_to_exceed_price_change
FROM PO_LINES_ALL POL,
PO_LINES_ARCHIVE_ALL POLA
WHERE POL.po_header_id = x_po_header_id
AND POL.po_line_id = POLA.po_line_id (+)
AND POLA.latest_external_flag (+) = 'Y';
SELECT max(po_chord_wf0.percentage_change(
POLA.quantity_committed, POL.quantity_committed))
INTO x_lines_control.quantity_committed_change
FROM PO_LINES_ALL POL,
PO_LINES_ARCHIVE_ALL POLA
WHERE POL.po_header_id = x_po_header_id
AND POL.po_line_id = POLA.po_line_id (+)
AND POLA.latest_external_flag (+) = 'Y';
SELECT max(po_chord_wf0.percentage_change(
POLA.committed_amount, POL.committed_amount))
INTO x_lines_control.committed_amount_change
FROM PO_LINES_ALL POL,
PO_LINES_ARCHIVE_ALL POLA
WHERE POL.po_header_id = x_po_header_id
AND POL.po_line_id = POLA.po_line_id (+)
AND POLA.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(POLA.order_type_lookup_code, 'RATE',POLA.amount,'FIXED PRICE', POLA.amount,
(POLA.quantity*POLA.unit_price)) / l_min_acct_unit )* l_min_acct_unit ,
round(
decode(POL.order_type_lookup_code, 'RATE',POL.amount,'FIXED PRICE', POL.amount,
(POL.quantity*POL.unit_price)) / l_min_acct_unit )* l_min_acct_unit
) )
INTO x_lines_control.amount_change
FROM PO_LINES_ALL POL,
PO_LINES_ARCHIVE_ALL POLA
WHERE POL.po_header_id = x_po_header_id
AND POL.po_line_id = POLA.po_line_id (+)
AND POLA.latest_external_flag (+) = 'Y';
SELECT max(po_chord_wf0.percentage_change(
round(
decode(POLA.order_type_lookup_code, 'RATE',POLA.amount,'FIXED PRICE', POLA.amount,
(POLA.quantity*POLA.unit_price )) , l_precision) ,
round(
decode(POL.order_type_lookup_code, 'RATE',POL.amount,'FIXED PRICE', POL.amount,
(POL.quantity*POL.unit_price )) , l_precision)
) )
INTO x_lines_control.amount_change
FROM PO_LINES_ALL POL,
PO_LINES_ARCHIVE_ALL POLA
WHERE POL.po_header_id = x_po_header_id
AND POL.po_line_id = POLA.po_line_id (+)
AND POLA.latest_external_flag (+) = 'Y';
SELECT max(trunc(POL.start_date-POLA.start_date))
INTO x_lines_control.start_date_change
FROM PO_LINES_ALL POL,
PO_LINES_ARCHIVE_ALL POLA
WHERE POL.po_header_id = x_po_header_id
AND POL.po_line_id = POLA.po_line_id (+)
AND POLA.latest_external_flag (+) = 'Y';
SELECT DISTINCT 'Y'
INTO x_lines_control.end_date
FROM PO_LINES POL,
PO_LINES_ARCHIVE_ALL POLA
WHERE POL.po_header_id = x_po_header_id
AND POL.po_line_id = POLA.po_line_id (+)
AND POLA.latest_external_flag (+) = 'Y'
AND (
(POLA.po_line_id is NULL)
OR (POL.expiration_date <> POLA.expiration_date)
OR (POL.expiration_date IS NULL AND POLA.expiration_date IS NOT NULL)
OR (POL.expiration_date IS NOT NULL AND POLA.expiration_date IS NULL)
);
SELECT max(trunc(POL.expiration_date-POLA.expiration_date))
INTO x_lines_control.end_date_change
FROM PO_LINES_ALL POL,
PO_LINES_ARCHIVE_ALL POLA
WHERE POL.po_header_id = x_po_header_id
AND POL.po_line_id = POLA.po_line_id (+)
AND POLA.latest_external_flag (+) = 'Y'
AND (POL.expiration_date IS NOT NULL OR POLA.expiration_date IS NOT NULL);
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** Finish: check_lines_change ***' );
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** In procedure: set_wf_lines_control ***');
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** Finished: set_wf_lines_control ***');
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** In procedure: get_wf_lines_control ***');
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** Finished: get_wf_lines_control ***');
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** In procedure get_wf_lines_parameters ***');
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'po_header_id = '|| to_char(x_lines_parameters.po_header_id));
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** FINISH: get_wf_lines_parameters ***');
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** In procedure: debug_lines_control ***');
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'line_num : ' || x_lines_control.line_num);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'item_id : ' || x_lines_control.item_id);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'item_revision : ' || x_lines_control.item_revision);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'category_id : ' || x_lines_control.category_id);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'item_description : ' || x_lines_control.item_description);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'unit_meas_lookup_code : ' || x_lines_control.unit_meas_lookup_code);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'un_number_id : ' || x_lines_control.un_number_id);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'hazard_class_id : ' || x_lines_control.hazard_class_id);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'note_to_vendor : ' || x_lines_control.note_to_vendor);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'from_header_id : ' || x_lines_control.from_header_id);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'closed_code : ' || x_lines_control.closed_code);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'vendor_product_num : ' || x_lines_control.vendor_product_num);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'contract_num : ' || x_lines_control.contract_num);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'price_type_lookup_code : ' || x_lines_control.price_type_lookup_code);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'cancel_flag : ' || x_lines_control.cancel_flag);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'retainage_rate : ' || x_lines_control.retainage_rate);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'max_retainage_amount : ' || x_lines_control.max_retainage_amount);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'progress_payment_rate : ' || x_lines_control.progress_payment_rate);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'recoupment_rate : ' || x_lines_control.recoupment_rate);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'advance_amount : ' || x_lines_control.advance_amount);
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'quantity_change : ' || to_char(x_lines_control.quantity_change));
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'unit_price_change : ' || to_char(x_lines_control.unit_price_change));
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'not_to_exceed_price_change : ' || to_char(x_lines_control.not_to_exceed_price_change));
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'quantity_committed_change : ' || to_char(x_lines_control.quantity_committed_change));
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'committed_amount_change : ' || to_char(x_lines_control.committed_amount_change));
PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
'amount_change : ' || to_char(x_lines_control.amount_change)); --
PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
'*** Finished: debug_lines_control ***');