The following lines contain the word 'select', 'insert', 'update' or 'delete':
select e1.expenditure_item_id,
e1.expenditure_type,
e1.expenditure_item_date ,
e1.task_id ,
e1.quantity ,
e1.creation_date ,
e1.created_by ,
e1.last_update_date ,
e1.last_updated_by ,
e1.last_update_login
from pa_expenditure_items_all e1
,pa_expenditures_all e2
where e2.expenditure_group = x_new_group
and e2.expenditure_id = e1.expenditure_id
and e1.expenditure_type = x_expenditure_type
and e1.task_id = x_task_id
and e1.quantity = x_quantity
and not exists (select 'X' from gms_award_distributions gad
where gad.expenditure_item_id = e1.expenditure_item_id
and gad.adl_status = 'A'
and gad.document_type ='EXP'
)
order by e1.expenditure_item_id asc ;
select e1.expenditure_item_id,
e1.expenditure_type,
e1.expenditure_item_date ,
e1.quantity,
e1.task_id ,
e1.creation_date ,
e1.created_by ,
e1.last_update_date ,
e1.last_updated_by ,
e1.last_update_login
from pa_expenditure_items_all e1
,pa_expenditures_all e2
,pa_expenditure_groups_all e3
where e3.expenditure_group = x_org_group
and e3.expenditure_group = e2.expenditure_group
and e2.expenditure_id = e1.expenditure_id
order by e1.expenditure_item_id asc;
select project_id into x_project_id
from pa_tasks
where task_id = x_task_id ;
select distinct(adl.project_id), adl.award_id into x_project_id , x_award_id
from gms_award_distributions adl
where adl.expenditure_item_id = org_rec.expenditure_item_id
and adl.document_type = 'EXP'
and adl.adl_status = 'A' ;
x_adl_rec.last_update_date := new_rec.last_update_date;
x_adl_rec.last_updated_by := new_rec.last_updated_by;
x_adl_rec.last_update_login := new_rec.last_update_login;
DELETE from pa_expenditure_items_all
WHERE expenditure_item_id = new_rec.expenditure_item_id ;
select e1.expenditure_item_id,
-- e1.project_id ,
e1.task_id ,
e1.creation_date ,
e1.created_by ,
e1.last_update_date ,
e1.last_updated_by ,
e1.last_update_login ,
e1.adjusted_expenditure_item_id
from pa_expenditure_items_all e1
,pa_expenditures_all e2
where e2.expenditure_group = x_reverse_group
and e2.expenditure_id = e1.expenditure_id ;
select project_id into x_project_id
from pa_tasks
where task_id = rev_rec.task_id ;
select distinct(project_id), award_id into x_project_id ,x_award_id
from gms_award_distributions adl
where expenditure_item_id = rev_rec.adjusted_expenditure_item_id
and adl.document_type = 'EXP'
and adl.adl_status = 'A' ;
x_adl_rec.last_update_date := rev_rec.last_update_date;
x_adl_rec.last_updated_by := rev_rec.last_updated_by;
x_adl_rec.last_update_login := rev_rec.last_update_login;
select e1.encumbrance_item_id,
e1.encumbrance_type ,
e1.encumbrance_item_date ,
e1.task_id ,
e1.amount ,
e1.creation_date ,
e1.created_by ,
e1.last_update_date ,
e1.last_updated_by ,
e1.last_update_login
from gms_encumbrance_items_all e1
,gms_encumbrances_all e2
where e2.encumbrance_group = x_new_group
and e2.encumbrance_id = e1.encumbrance_id
and e1.encumbrance_type = x_encumbrance_type
and e1.task_id = x_task_id
and e1.amount = x_amount
and not exists (select 'X' from gms_award_distributions gad
where gad.expenditure_item_id = e1.encumbrance_item_id
and gad.adl_status = 'A'
and gad.document_type ='ENC'
)
order by e1.encumbrance_item_id asc;
select e1.encumbrance_item_id ,
e1.encumbrance_type ,
e1.encumbrance_item_date ,
e1.amount ,
e1.task_id ,
e1.creation_date ,
e1.created_by ,
e1.last_update_date ,
e1.last_updated_by ,
e1.last_update_login
from gms_encumbrance_items_all e1
,gms_encumbrances_all e2
,gms_encumbrance_groups_all e3
where e3.encumbrance_group = x_org_group
and e3.encumbrance_group = e2.encumbrance_group
and e2.encumbrance_id = e1.encumbrance_id
order by e1.encumbrance_item_id asc ;
select project_id into x_project_id
from pa_tasks
where task_id = x_task_id ;
select distinct(adl.project_id) ,adl.award_id into x_project_id , x_award_id
from gms_award_distributions adl
where adl.expenditure_item_id = org_rec.encumbrance_item_id
and adl.document_type = 'ENC'
and nvl(adl.reversed_flag, 'N') = 'N' --Bug 5726575
and adl.line_num_reversed is null --Bug 5726575
and adl.adl_status = 'A' ;
x_adl_rec.last_update_date := new_rec.last_update_date;
x_adl_rec.last_updated_by := new_rec.last_updated_by;
x_adl_rec.last_update_login := new_rec.last_update_login;
select e1.encumbrance_item_id,
e1.task_id ,
e1.creation_date ,
e1.created_by ,
e1.last_update_date ,
e1.last_updated_by ,
e1.last_update_login ,
e1.adjusted_encumbrance_item_id
from gms_encumbrance_items_all e1
,gms_encumbrances_all e2
where e2.encumbrance_group = x_new_group
and e2.encumbrance_id = e1.encumbrance_id;
select project_id into x_project_id
from pa_tasks
where task_id = rev_rec.task_id ;
select distinct(adl.project_id), adl.award_id into x_project_id , x_award_id
from gms_award_distributions adl
where expenditure_item_id = rev_rec.adjusted_encumbrance_item_id
and adl.document_type ='ENC'
and nvl(adl.reversed_flag, 'N') = 'N' --Bug 5726575
and adl.line_num_reversed is null --Bug 5726575
and adl.adl_status = 'A' ;
x_adl_rec.last_update_date := rev_rec.last_update_date;
x_adl_rec.last_updated_by := rev_rec.last_updated_by;
x_adl_rec.last_update_login := rev_rec.last_update_login;