The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT RT.consigned_flag,
RT.source_document_code,
RT.transaction_type,
RT.parent_transaction_id,
RT.po_header_id,
RT.po_line_location_id --12i Complex Work Procurement
INTO l_consigned_flag,
l_source_doc_code,
l_transaction_type,
l_parent_trx_id,
l_po_header_id,
l_po_line_location_id --12i Complex Work Procurement
FROM rcv_transactions RT
WHERE transaction_id = p_rcv_transaction_id;
SELECT transaction_type, parent_transaction_id
INTO l_parent_trx_type, l_grparent_trx_id
FROM rcv_transactions
WHERE transaction_id = l_parent_trx_id;
SELECT transaction_type
INTO l_grparent_trx_type
FROM rcv_transactions
WHERE transaction_id = l_grparent_trx_id;
SELECT shipment_type
INTO l_shipment_type
FROM po_line_locations
WHERE line_location_id = l_po_line_location_id;
SELECT transaction_id, organization_id
FROM rcv_transactions
WHERE ( ( transaction_type = 'RECEIVE'
and parent_transaction_id = -1 )
or
transaction_type = 'MATCH' )
AND NVL(consigned_flag,'N') <> 'Y'
AND po_header_id = p_po_header_id
AND po_line_location_id = p_po_line_location_id
AND NVL(po_release_id, -1) = NVL(p_po_release_id, -1);
SELECT transaction_id, po_distribution_id
FROM rcv_transactions
WHERE transaction_type = 'DELIVER'
START WITH transaction_id = l_par_txn
CONNECT BY parent_transaction_id = prior transaction_id;
SELECT POD.po_distribution_id
FROM po_distributions POD,
po_line_locations POLL,
rcv_transactions RT
WHERE POD.line_location_id = POLL.line_location_id
AND POLL.line_location_id = RT.po_line_location_id
AND RT.transaction_id = l_rcv_txn;
SELECT POLL.matching_basis, POLL.shipment_type
INTO l_matching_basis, l_shipment_type
FROM po_line_locations POLL
WHERE POLL.line_location_id = p_po_line_location_id;
SELECT org_id
INTO l_proc_operating_unit
FROM po_headers
WHERE po_header_id = p_po_header_id;
SELECT count(*)
INTO l_rae_count
FROM rcv_accounting_events
WHERE rcv_transaction_id = c_par_txn.transaction_id;
SELECT RAE.organization_id, RAE.trx_flow_header_id, NVL(RT.dropship_type_code,3)
INTO l_organization_id, l_trx_flow_header_id,l_drop_ship_flag
FROM rcv_accounting_events RAE,
rcv_transactions RT
WHERE RAE.rcv_transaction_id = c_par_txn.transaction_id
AND RT.transaction_id = RAE.rcv_transaction_id
AND RAE.procurement_org_flag = 'Y'
AND rownum = 1;
SELECT nvl(po_distribution_id, -1)
INTO l_po_distribution_id
FROM rcv_transactions
WHERE transaction_id = c_par_txn.transaction_id;
RCV_SeedEvents_PVT.Insert_RAEEvents(
p_api_version => 1.0,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_rcv_events_tbl => l_rcv_events_tbl,
/* Support for Landed Cost Management */
p_lcm_flag => 'N');
l_api_message := 'Error inserting events into RAE';
SELECT po_distribution_id,destination_type_code, project_id
FROM po_distributions POD
WHERE POD.po_distribution_id = NVL(p_po_distribution_id,POD.po_distribution_id)
AND POD.line_location_id = p_po_line_location_id;
SELECT
RT.po_header_id,
RT.po_line_id,
RT.po_line_location_id,
RT.po_distribution_id,
RT.transaction_date,
nvl(RT.dropship_type_code,3),
POH.org_id,
POLL.ship_to_organization_id,
POL.item_id,
POL.category_id,
POL.project_id,
nvl(POLL.accrue_on_receipt_flag,'N'),
POH.type_lookup_code,
/* Support for Landed Cost Management */
nvl(POLL.lcm_flag, 'N')
INTO l_po_header_id,
l_po_line_id,
l_po_line_location_id,
l_po_distribution_id,
l_rcv_trx_date,
l_drop_ship_flag,
l_po_org_id,
l_rcv_organization_id,
l_item_id,
l_category_id,
l_project_id,
l_accrual_flag,
l_po_document_type_code,
/* Support for Landed Cost Management */
l_lcm_flag
FROM po_headers POH,
po_line_locations POLL,
po_lines POL,
rcv_transactions RT
WHERE RT.transaction_id = p_rcv_transaction_id
AND POH.po_header_id = RT.po_header_id
AND POLL.line_location_id = RT.po_line_location_id
AND POL.po_line_id = RT.po_line_id;
SELECT operating_unit, ledger_id
INTO l_rcv_org_id, l_rcv_sob_id
FROM cst_acct_info_v
WHERE organization_id = l_rcv_organization_id;
SELECT set_of_books_id
INTO l_po_sob_id
FROM financials_system_parameters;
SELECT decode(RT.transaction_type,'CORRECT',RCV_SeedEvents_PVT.CORRECT,
RCV_SeedEvents_PVT.RECEIVE)
INTO l_event_type_id
FROM rcv_Transactions RT
WHERE transaction_id = p_rcv_transaction_id;
,'Inserting events into RAE');
RCV_SeedEvents_PVT.Insert_RAEEvents(
p_api_version => 1.0,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_rcv_events_tbl => l_rcv_events_tbl,
/* Support for Landed Cost Management */
p_lcm_flag => l_lcm_flag);
l_api_message := 'Error inserting events into RAE';
,'Inserting events into MMT');
RCV_SeedEvents_PVT.Insert_MMTEvents(
p_api_version => 1.0,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_rcv_events_tbl => l_rcv_events_tbl);
l_api_message := 'Error inserting events into MMT';
SELECT
RT.po_header_id,
RT.po_distribution_id,
POD.destination_type_code,
RT.transaction_date,
nvl(RT.dropship_type_code,3),
POH.org_id,
POLL.ship_to_organization_id,
POL.category_id,
POL.project_id,
nvl(POLL.accrue_on_receipt_flag,'N'),
POH.type_lookup_code,
/* Support for Landed Cost Management */
NVL(POLL.lcm_flag,'N')
INTO l_po_header_id,
l_po_distribution_id,
l_destination_type,
l_rcv_trx_date,
l_drop_ship_flag,
l_po_org_id,
l_rcv_organization_id,
l_category_id,
l_project_id,
l_accrual_flag,
l_po_document_type_code,
/* Support for Landed Cost Management */
l_lcm_flag
FROM po_headers POH,
po_line_locations POLL,
po_lines POL,
po_distributions POD,
rcv_transactions RT
WHERE RT.transaction_id = p_rcv_transaction_id
AND POH.po_header_id = RT.po_header_id
AND POLL.line_location_id = RT.po_line_location_id
AND POL.po_line_id = RT.po_line_id
AND POD.po_distribution_id = RT.po_distribution_id;
SELECT operating_unit, ledger_id
INTO l_rcv_org_id, l_rcv_sob_id
FROM cst_acct_info_v
WHERE organization_id = l_rcv_organization_id;
SELECT set_of_books_id
INTO l_po_sob_id
FROM financials_system_parameters;
SELECT decode(RT.transaction_type,'CORRECT',RCV_SeedEvents_PVT.CORRECT,
RCV_SeedEvents_PVT.DELIVER)
INTO l_event_type_id
FROM rcv_Transactions RT
WHERE transaction_id = p_rcv_transaction_id;
,'Inserting events into RAE');
RCV_SeedEvents_PVT.Insert_RAEEvents(
p_api_version => 1.0,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_rcv_events_tbl => l_rcv_events_tbl,
/* Support for Landed Cost Management */
p_lcm_flag => l_lcm_flag);
l_api_message := 'Error inserting events into RAE';
SELECT
RT.po_header_id,
RT.po_distribution_id,
POD.destination_type_code,
RT.transaction_date,
nvl(RT.dropship_type_code,3),
POH.org_id,
POLL.ship_to_organization_id,
POL.category_id,
POL.project_id,
nvl(POLL.accrue_on_receipt_flag,'N'),
POH.type_lookup_code,
/* Support for Landed Cost Management */
nvl(POLL.lcm_flag, 'N')
INTO l_po_header_id,
l_po_distribution_id,
l_destination_type,
l_rcv_trx_date,
l_drop_ship_flag,
l_po_org_id,
l_rcv_organization_id,
l_category_id,
l_project_id,
l_accrual_flag,
l_po_document_type_code,
/* Support for Landed Cost Management */
l_lcm_flag
FROM po_headers POH,
po_line_locations POLL,
po_lines POL,
po_distributions POD,
rcv_transactions RT
WHERE RT.transaction_id = p_rcv_transaction_id
AND POH.po_header_id = RT.po_header_id
AND POLL.line_location_id = RT.po_line_location_id
AND POL.po_line_id = RT.po_line_id
AND POD.po_distribution_id = RT.po_distribution_id;
SELECT operating_unit, ledger_id
INTO l_rcv_org_id, l_rcv_sob_id
FROM cst_acct_info_v
WHERE organization_id = l_rcv_organization_id;
SELECT set_of_books_id
INTO l_po_sob_id
FROM financials_system_parameters;
SELECT decode(RT.transaction_type,'CORRECT',RCV_SeedEvents_PVT.CORRECT,
RCV_SeedEvents_PVT.RETURN_TO_RECEIVING)
INTO l_event_type_id
FROM rcv_Transactions RT
WHERE transaction_id = p_rcv_transaction_id;
,'Inserting events into RAE');
RCV_SeedEvents_PVT.Insert_RAEEvents(
p_api_version => 1.0,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_rcv_events_tbl => l_rcv_events_tbl,
/* Support for Landed Cost Management */
p_lcm_flag => l_lcm_flag);
l_api_message := 'Error inserting events into RAE';
SELECT po_distribution_id,destination_type_code, project_id
FROM po_distributions POD
WHERE POD.po_distribution_id = NVL(p_po_distribution_id,POD.po_distribution_id)
AND POD.line_location_id = p_po_line_location_id;
SELECT
RT.po_header_id,
RT.po_line_id,
RT.po_line_location_id,
RT.po_distribution_id,
RT.transaction_date,
nvl(RT.dropship_type_code,3),
POH.org_id,
POLL.ship_to_organization_id,
POL.item_id,
POL.category_id,
POL.project_id,
nvl(POLL.accrue_on_receipt_flag,'N'),
POH.type_lookup_code,
/* Support for Landed Cost Management */
nvl(POLL.lcm_flag, 'N')
INTO l_po_header_id,
l_po_line_id,
l_po_line_location_id,
l_po_distribution_id,
l_rcv_trx_date,
l_drop_ship_flag,
l_po_org_id,
l_rcv_organization_id,
l_item_id,
l_category_id,
l_project_id,
l_accrual_flag,
l_po_document_type_code,
/* Support for Landed Cost Management */
l_lcm_flag
FROM po_headers POH,
po_line_locations POLL,
po_lines POL,
rcv_transactions RT
WHERE RT.transaction_id = p_rcv_transaction_id
AND POH.po_header_id = RT.po_header_id
AND POLL.line_location_id = RT.po_line_location_id
AND POL.po_line_id = RT.po_line_id;
SELECT operating_unit, ledger_id
INTO l_rcv_org_id, l_rcv_sob_id
FROM cst_acct_info_v
WHERE organization_id = l_rcv_organization_id;
SELECT set_of_books_id
INTO l_po_sob_id
FROM financials_system_parameters;
SELECT decode(RT.transaction_type,'CORRECT',RCV_SeedEvents_PVT.CORRECT,
RCV_SeedEvents_PVT.RETURN_TO_VENDOR)
INTO l_event_type_id
FROM rcv_Transactions RT
WHERE transaction_id = p_rcv_transaction_id;
,'Inserting events into RAE');
RCV_SeedEvents_PVT.Insert_RAEEvents(
p_api_version => 1.0,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_rcv_events_tbl => l_rcv_events_tbl,
/* Support for Landed Cost Management */
p_lcm_flag => l_lcm_flag);
l_api_message := 'Error inserting events into RAE';
,'Inserting events into MMT');
RCV_SeedEvents_PVT.Insert_MMTEvents(
p_api_version => 1.0,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_rcv_events_tbl => l_rcv_events_tbl);
l_api_message := 'Error inserting events into MMT';
SELECT
RT.consigned_flag,
RT.source_document_code,
RT.transaction_type,
RT.parent_transaction_id,
RT.po_header_id,
RT.po_line_id,
RT.po_line_location_id,
RT.po_distribution_id,
POD.destination_type_code,
RT.transaction_date,
nvl(RT.dropship_type_code,3),
POH.org_id,
POLL.ship_to_organization_id,
POL.item_id,
POL.category_id,
POL.project_id,
nvl(POLL.accrue_on_receipt_flag,'N'),
/* Support for Landed Cost Management */
nvl(POLL.lcm_flag, 'N')
INTO l_consigned_flag,
l_source_doc_code,
l_transaction_type,
l_parent_trx_id,
l_po_header_id,
l_po_line_id,
l_po_line_location_id,
l_po_distribution_id,
l_destination_type,
l_rcv_trx_date,
l_drop_ship_flag,
l_po_org_id,
l_rcv_organization_id,
l_item_id,
l_category_id,
l_project_id,
l_accrual_flag,
/* Support for Landed Cost Management */
l_lcm_flag
FROM po_headers POH,
po_line_locations POLL,
po_lines POL,
po_distributions POD,
rcv_transactions RT
WHERE RT.transaction_id = p_rcv_transaction_id
AND POH.po_header_id = RT.po_header_id
AND POLL.line_location_id = RT.po_line_location_id
AND POL.po_line_id = RT.po_line_id
AND POD.po_distribution_id = RT.po_distribution_id;
SELECT transaction_type
INTO l_parent_trx_type
FROM rcv_transactions PARENT
WHERE PARENT.transaction_id = l_parent_trx_id;
SELECT operating_unit, ledger_id
INTO l_rcv_org_id, l_rcv_sob_id
FROM cst_acct_info_v
WHERE organization_id = l_rcv_organization_id;
SELECT set_of_books_id
INTO l_po_sob_id
FROM financials_system_parameters;
SELECT nvl(clearing_account_id, receiving_account_id)
INTO l_clearing_acct_id
FROM rcv_parameters
WHERE organization_id = l_rcv_organization_id;