The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT p.party_id
FROM hz_parties p
WHERE p.party_name = l_initiator_name
and p.party_type='ORGANIZATION'
and exists (select u.party_usg_assignment_id from hz_party_usg_assignments u
where u.party_usage_code = 'INTERCOMPANY_ORG'
and u.party_id = p.party_id);
SELECT legal_entity_id
FROM xle_firstparty_information_v
WHERE name=l_from_le_name;
/*SELECT hp.party_id
FROM hz_parties hp, hz_code_assignments hca
WHERE hp.party_name = l_From_Le_name
and hca.owner_table_name like 'HZ_PARTIES'
and hca.owner_table_id = hp.party_id
and hca.class_code like 'LEGAL_ENTITY'
and hca.class_category like 'LEGAL_FUNCTION';*/
SELECT ledger_id
FROM gl_ledger_le_v
WHERE legal_entity_id = l_from_le_id
AND ledger_category_code = 'PRIMARY';
SELECT trx_type_id
FROM fun_Trx_types_vl
WHERE trx_type_name = l_Trx_type_name;
SELECT trx_type_id
FROM fun_Trx_types_vl
WHERE trx_type_code = l_Trx_type_code;
SELECT trx_type_code
FROM fun_Trx_types_vl
WHERE trx_type_id = l_Trx_type_id;
SELECT legal_entity_id
FROM xle_firstparty_information_v
WHERE party_id = l_party_id;
SELECT p.party_id
FROM hz_parties p
WHERE p.party_name = l_recipient_name
and p.party_type='ORGANIZATION'
and exists (select u.party_usg_assignment_id from hz_party_usg_assignments u
where u.party_usage_code = 'INTERCOMPANY_ORG'
and u.party_id = p.party_id);
SELECT legal_entity_id
FROM xle_firstparty_information_v
WHERE name=l_to_le_name;
/*SELECT hp.party_id
FROM hz_parties hp, hz_code_assignments hca
WHERE hp.party_name = l_to_Le_name
and hca.owner_table_name like 'HZ_PARTIES'
and hca.owner_table_id = hp.party_id;
SELECT ledger_id
FROM gl_ledger_le_v
WHERE legal_entity_id = l_to_le_id
AND ledger_category_code = 'PRIMARY';
SELECT legal_entity_id
FROM xle_firstparty_information_v
WHERE party_id = l_party_id;
SELECT * FROM fun_interface_batches
WHERE source = p_source
AND group_id = p_group_id;
Select * from fun_interface_headers
Where batch_id = l_batch_id;
Select * from fun_interface_dist_lines
Where trx_id = l_trx_id;
Select * from fun_interface_batchdists
Where batch_id = l_batch_id;
Select allow_invoicing_flag
from fun_trx_types_vl
where trx_type_id = c_trx_type_id;
/* Delete any rejections from previous failed imports*/
Delete from fun_interface_rejections;
SELECT exchg_rate_type, default_currency
INTO l_exchg_rate_type, l_default_currency
FROM fun_system_options;
/*Select Batches for a given Source and Group.*/
Print('Main Package ~~~'||'Reject Allowed Derived from System Options');
SELECT numbering_type
INTO l_numbering_type
FROM fun_system_options;
/* SELECT FUN_SEQ_S1.nextval
INTO l_batch_num
FROM dual;
SELECT nvl(sum(init_amount_dr),0), nvl(sum(init_amount_cr),0)
INTO l_running_total_dr, l_running_total_cr
FROM fun_interface_headers
WHERE batch_id = curr_batch.batch_id;
Print('Main Package ~~~'||' Call the Public API to Validate and Insert Intercompany Transactions');
p_insert => FND_API.G_TRUE,
p_batch_rec => l_batch_rec,
p_trx_tbl => l_trx_tbl,
p_init_dist_tbl => l_init_dist_tbl,
p_dist_lines_tbl => l_dist_lines_tbl,
p_debug =>p_debug
);
Print('Main Package ~~~'||'Validation and Insertion Complete with Status' || l_return_status);
UPDATE fun_interface_batches set import_status_code = Overall_Status
Where batch_id = curr_batch.batch_id;
l_trx_tbl.delete;
l_init_dist_tbl.delete;
l_dist_lines_tbl.delete;
/*update control table with the request id */
update fun_interface_controls
set request_id = v_request_id,
date_processed = sysdate
where source = p_source
and group_id = p_group_id;
Delete from fun_interface_dist_lines where
Trx_id in (select trx_id from fun_interface_headers where
batch_id in (select batch_id from fun_interface_batches where
source = p_source and group_id = p_group_id and import_status_code = 'A')) ;
Delete from fun_interface_batchdists where
batch_id in (select batch_id from fun_interface_batches where
source = p_source and group_id = p_group_id and import_status_code = 'A');
Delete from fun_interface_headers where
Batch_id in (select batch_id from fun_interface_batches where
source = p_source and group_id = p_group_id and import_status_code = 'A');
Delete from fun_interface_batches where
source = p_source and group_id = p_group_id
and import_status_code = 'A';
select count(*) into l_count
from fun_interface_rejections;
Delete from fun_interface_controls where source = p_source
and group_id = p_group_id;