The following lines contain the word 'select', 'insert', 'update' or 'delete':
FUNCTION check_update_add_pa(p_fund_allocation_id NUMBER) RETURN BOOLEAN is
cursor c_exist is
select 'Y'
from oke_k_fund_allocations
where fund_allocation_id = p_fund_allocation_id
and agreement_version is not null;
END check_update_add_pa;
FUNCTION check_update_add(p_fund_allocation_id NUMBER) RETURN BOOLEAN is
cursor c_update is
select 'x'
from oke_k_fund_allocations
where fund_allocation_id = p_fund_allocation_id;
OPEN c_update;
FETCH c_update into l_dummy_value;
CLOSE c_update;
CLOSE c_update;
IF (c_update%ISOPEN) THEN
CLOSE c_update;
END check_update_add;
select 'x'
from pa_agreements_all
where agreement_id = p_agreement_id
and pm_product_code = G_PRODUCT_CODE
and substr(pm_agreement_reference, -1 * x_length, x_length) = '-'|| p_funding_source_id;
select fund_allocation_id ,
funding_source_id ,
project_id ,
task_id ,
amount ,
start_date_active ,
pa_conversion_type ,
pa_conversion_date ,
pa_conversion_rate,
funding_category
from oke_k_fund_allocations
where fund_allocation_id = p_fund_allocation_id;
OKE_FUNDSOURCE_PVT.update_funding(p_api_version => p_api_version ,
p_init_msg_list => OKE_API.G_FALSE ,
p_commit => OKE_API.G_FALSE ,
p_msg_count => x_msg_count ,
p_msg_data => x_msg_data ,
p_funding_in_rec => l_funding_in_rec ,
p_funding_out_rec => x_funding_out_rec ,
p_return_status => x_return_status
);
PROCEDURE update_funding(p_api_version IN NUMBER ,
p_init_msg_list IN VARCHAR2 := OKE_API.G_FALSE ,
p_commit IN VARCHAR2 := OKE_API.G_FALSE ,
x_return_status OUT NOCOPY VARCHAR2 ,
x_msg_count OUT NOCOPY NUMBER ,
x_msg_data OUT NOCOPY VARCHAR2 ,
p_agreement_flag IN VARCHAR2 := OKE_API.G_FALSE ,
p_agreement_type IN VARCHAR2 ,
p_receivables_term_id IN NUMBER DEFAULT NULL,
p_funding_in_rec IN FUNDING_REC_IN_TYPE ,
x_funding_out_rec OUT NOCOPY FUNDING_REC_OUT_TYPE ,
p_allocation_in_tbl IN ALLOCATION_IN_TBL_TYPE ,
x_allocation_out_tbl OUT NOCOPY ALLOCATION_OUT_TBL_TYPE
) is
l_api_name CONSTANT VARCHAR2(30) := 'update_funding';
select term_id
from pa_agreements_all where pm_product_code = 'OKE'
and pm_agreement_reference LIKE '%-' || to_char(p_funding_in_rec.funding_source_id);
IF (check_update_add(p_fund_allocation_id => l_allocation_in_rec.fund_allocation_id)) THEN
OKE_ALLOCATION_PVT.update_allocation(p_api_version => p_api_version ,
p_init_msg_list => OKE_API.G_FALSE ,
p_commit => OKE_API.G_FALSE ,
p_return_status => x_return_status ,
p_msg_count => x_msg_count ,
p_msg_data => x_msg_data ,
p_allocation_in_rec => l_allocation_in_rec ,
p_allocation_out_rec => l_allocation_out_rec ,
p_validation_flag => OKE_API.G_FALSE
);
OKE_FUNDSOURCE_PVT.update_funding(p_api_version => p_api_version ,
p_init_msg_list => OKE_API.G_FALSE ,
p_commit => OKE_API.G_FALSE ,
p_msg_count => x_msg_count ,
p_msg_data => x_msg_data ,
p_funding_in_rec => p_funding_in_rec ,
p_funding_out_rec => x_funding_out_rec ,
p_return_status => x_return_status );
OKE_AGREEMENT_PVT.update_agreement(p_api_version => p_api_version ,
p_init_msg_list => OKE_API.G_FALSE ,
p_commit => OKE_API.G_FALSE ,
p_msg_count => x_msg_count ,
p_msg_data => x_msg_data ,
p_agreement_type => p_agreement_type ,
p_funding_in_rec => p_funding_in_rec ,
-- p_allocation_in_tbl => p_allocation_in_tbl ,
p_return_status => x_return_status ,
p_receivables_term_id => l_receivables_term_id
);
END update_funding;
PROCEDURE delete_funding(p_api_version IN NUMBER ,
p_init_msg_list IN VARCHAR2 := OKE_API.G_FALSE ,
p_commit IN VARCHAR2 := OKE_API.G_FALSE ,
x_return_status OUT NOCOPY VARCHAR2 ,
x_msg_count OUT NOCOPY NUMBER ,
x_msg_data OUT NOCOPY VARCHAR2 ,
p_funding_source_id IN NUMBER
-- p_agreement_flag IN VARCHAR2 := OKE_API.G_FALSE
) is
-- l_length NUMBER;
select fund_allocation_id
from oke_k_fund_allocations
where funding_source_id = p_funding_source_id
order by amount asc;
l_api_name CONSTANT VARCHAR2(30) := 'delete_funding';
OKE_ALLOCATION_PVT.delete_allocation(p_api_version => p_api_version ,
p_init_msg_list => OKE_API.G_FALSE ,
p_commit => OKE_API.G_FALSE ,
p_return_status => x_return_status ,
p_msg_count => x_msg_count ,
p_msg_data => x_msg_data ,
p_fund_allocation_id => l_allocation_id.fund_allocation_id
);
OKE_FUNDSOURCE_PVT.delete_funding(p_api_version => p_api_version ,
p_commit => OKE_API.G_FALSE ,
p_init_msg_list => OKE_API.G_FALSE ,
p_msg_count => x_msg_count ,
p_msg_data => x_msg_data ,
p_funding_source_id => p_funding_source_id ,
-- p_agreement_flag => p_agreement_flag ,
p_return_status => x_return_status
);
END delete_funding;
PROCEDURE update_allocation(p_api_version IN NUMBER ,
p_init_msg_list IN VARCHAR2 := OKE_API.G_FALSE ,
p_commit IN VARCHAR2 := OKE_API.G_FALSE ,
x_return_status OUT NOCOPY VARCHAR2 ,
x_msg_count OUT NOCOPY NUMBER ,
x_msg_data OUT NOCOPY VARCHAR2 ,
p_agreement_flag IN VARCHAR2 := OKE_API.G_FALSE ,
p_allocation_in_rec IN ALLOCATION_REC_IN_TYPE ,
x_allocation_out_rec OUT NOCOPY ALLOCATION_REC_OUT_TYPE
) is
l_api_name CONSTANT VARCHAR2(30) := 'update_allocation';
OKE_ALLOCATION_PVT.update_allocation(p_api_version => p_api_version ,
p_init_msg_list => OKE_API.G_FALSE ,
p_commit => OKE_API.G_FALSE ,
p_msg_count => x_msg_count ,
p_msg_data => x_msg_data ,
p_allocation_in_rec => p_allocation_in_rec ,
p_allocation_out_rec => x_allocation_out_rec ,
p_validation_flag => OKE_API.G_TRUE ,
p_return_status => x_return_status
);
IF (check_update_add_pa(p_fund_allocation_id => p_allocation_in_rec.fund_allocation_id)) THEN
--dbms_output.put_line('calling oke_agreement_pvt.update_pa_funding from oke_funding_pub');
OKE_AGREEMENT_PVT.update_pa_funding(p_api_version => p_api_version ,
p_init_msg_list => OKE_API.G_FALSE ,
p_commit => OKE_API.G_FALSE ,
p_msg_count => x_msg_count ,
p_msg_data => x_msg_data ,
p_allocation_in_rec => l_allocation_in_rec ,
p_return_status => x_return_status
);
END update_allocation;
PROCEDURE delete_allocation(p_api_version IN NUMBER ,
p_init_msg_list IN VARCHAR2 := OKE_API.G_FALSE ,
p_commit IN VARCHAR2 := OKE_API.G_FALSE ,
x_return_status OUT NOCOPY VARCHAR2 ,
x_msg_count OUT NOCOPY NUMBER ,
x_msg_data OUT NOCOPY VARCHAR2 ,
p_fund_allocation_id IN NUMBER
-- p_agreement_flag IN VARCHAR2 := OKE_API.G_FALSE
) is
l_api_name CONSTANT VARCHAR2(30) := 'delete_allocation';
select s.amount, s.hard_limit, s.revenue_hard_limit, s.funding_source_id
from oke_k_funding_sources s,
oke_k_fund_allocations f
where s.funding_source_id = f.funding_source_id
and f.fund_allocation_id = p_fund_allocation_id;
select sum(amount), sum(hard_limit), sum(revenue_hard_limit)
from oke_k_fund_allocations
where funding_source_id = x_funding_source_id;
OKE_ALLOCATION_PVT.delete_allocation(p_api_version => p_api_version ,
p_commit => OKE_API.G_FALSE ,
p_init_msg_list => OKE_API.G_FALSE ,
p_msg_count => x_msg_count ,
p_msg_data => x_msg_data ,
p_fund_allocation_id => p_fund_allocation_id ,
p_return_status => x_return_status
);
END delete_allocation;