The following lines contain the word 'select', 'insert', 'update' or 'delete':
Select category_id
From fa_category_books
Where book_type_code = p_book;
Select bk.asset_id,
bk.date_placed_in_service,
bk.life_in_months,
nvl(bk.cost,0) cost,
nvl(bk.adjusted_cost,0) adjusted_cost,
nvl(bk.original_cost,0) original_cost,
nvl(bk.salvage_value,0) salvage_value,
nvl(bk.adjusted_recoverable_cost, 0) adjusted_recoverable_cost,
nvl(bk.recoverable_cost,0) recoverable_cost,
bk.deprn_start_date,
bk.cost_change_flag,
bk.rate_adjustment_factor,
bk.depreciate_flag,
bk.fully_rsvd_revals_counter,
bk.period_counter_fully_reserved,
bk.period_counter_fully_retired,
ad.asset_number,
ad.asset_type
From fa_books bk,
fa_additions ad
Where bk.book_type_code = p_book
and bk.asset_id = ad.asset_id
and bk.transaction_header_id_out is null
and ad.asset_category_id = p_category_id;
Select fiscal_year
From fa_deprn_periods dp
Where book_type_code = p_book
and period_counter = p_period_counter;
Select asset_id,
date_placed_in_service,
life_in_months,
nvl(cost,0) cost,
nvl(adjusted_cost,0) adjusted_cost,
nvl(original_cost,0) original_cost,
nvl(salvage_value,0) salvage_value,
nvl(adjusted_recoverable_cost, 0) adjusted_recoverable_cost,
nvl(recoverable_cost,0) recoverable_cost,
deprn_start_date,
cost_change_flag,
rate_adjustment_factor,
depreciate_flag,
fully_rsvd_revals_counter,
period_counter_fully_reserved,
period_counter_fully_retired
From fa_books
Where book_type_code = p_book
and date_ineffective is null
and asset_id = p_asset_id;
Select nvl(sum(deprn_amount),0) deprn_amount,
nvl(sum(deprn_reserve),0) deprn_reserve,
nvl(sum(cost),0) cost,
nvl(sum(reval_reserve),0) reval_reserve,
nvl(sum(ytd_deprn),0) ytd_deprn,
nvl(sum(deprn_adjustment_amount),0) deprn_adjustment_amount
From fa_deprn_detail
Where book_type_code = p_book
and period_counter = p_period_counter
and asset_id = p_asset_id
and deprn_source_code = 'D'
Group by asset_id;
Select nvl(deprn_amount,0) deprn_amount,
nvl(ytd_deprn,0) ytd_deprn,
nvl(deprn_reserve,0) deprn_reserve,
deprn_source_code,
nvl(reval_reserve,0) reval_reserve,
nvl(adjusted_cost,0) adjusted_cost
From fa_deprn_summary
Where book_type_code = p_book
and period_counter = p_period_counter
and asset_id = p_asset_id
and deprn_source_code = 'DEPRN';
Select max(Period_counter) period_counter
From fa_deprn_summary
Where book_type_code = p_book
and asset_id = p_asset_id
and deprn_source_code = 'DEPRN';
Update igi_imp_iac_controls
Set Request_status = p_flag,
Request_id = fnd_global.conc_request_id,
Request_date = sysdate,
Last_updated_by = fnd_global.user_id,
last_update_date = sysdate,
last_update_login = fnd_global.login_id
Where book_type_code = p_book;
p_string => 'igi_imp_iac_controls updated, Request_status set to '
|| p_flag || ' for Book ' || p_book);
p_string => 'Error during update of Request Status to ' || p_flag);
Insert into igi_imp_iac_interface(
Asset_id,
Asset_number,
Book_type_code,
Category_id,
Hist_salvage_value,
Life_in_months,
Cost_hist,
Cost_mhca,
Deprn_exp_hist,
Deprn_exp_mhca,
Ytd_hist,
Ytd_mhca,
Accum_deprn_hist,
Accum_deprn_mhca,
Reval_reserve_hist,
Reval_reserve_mhca,
Backlog_hist,
Backlog_mhca,
General_fund_hist,
General_fund_mhca,
General_fund_per_hist,
General_fund_per_mhca,
Operating_account_hist,
Operating_account_mhca,
Operating_account_ytd_hist,
Operating_account_ytd_mhca,
Operating_account_cost,
Operating_account_backlog,
Nbv_hist,
Nbv_mhca,
Transferred_flag,
Selected_Flag,
Exception_Flag,
Exception_code,
Group_id,
Export_file,
Export_date,
Import_file,
Import_date,
Created_by,
Creation_date,
Last_updated_by,
Last_update_date,
Last_update_login,
Request_id,
Program_application_id,
Program_id,
Program_update_date,
Valid_flag) -- Added as a part of fix for Bug 5137813
Values(
p_interface_rec.Asset_id,
p_interface_rec.Asset_number,
p_interface_rec.Book_type_code,
p_interface_rec.Category_id,
p_interface_rec.Hist_salvage_value,
p_interface_rec.Life_in_months,
p_interface_rec.Cost_hist,
p_interface_rec.Cost_mhca,
p_interface_rec.Deprn_exp_hist,
p_interface_rec.Deprn_exp_mhca,
p_interface_rec.Ytd_hist,
p_interface_rec.Ytd_mhca,
p_interface_rec.Accum_deprn_hist,
p_interface_rec.Accum_deprn_mhca,
p_interface_rec.Reval_reserve_hist,
p_interface_rec.Reval_reserve_mhca,
p_interface_rec.Backlog_hist,
p_interface_rec.Backlog_mhca,
p_interface_rec.General_fund_hist,
p_interface_rec.General_fund_mhca,
p_interface_rec.General_fund_per_hist,
p_interface_rec.General_fund_per_mhca,
p_interface_rec.Operating_account_hist,
p_interface_rec.Operating_account_mhca,
p_interface_rec.Operating_account_ytd_hist,
p_interface_rec.Operating_account_ytd_mhca,
p_interface_rec.Operating_account_cost,
p_interface_rec.Operating_account_backlog,
p_interface_rec.Nbv_hist,
p_interface_rec.Nbv_mhca,
p_interface_rec.Transferred_flag,
p_interface_rec.Selected_Flag,
p_interface_rec.Exception_Flag,
p_interface_rec.Exception_code,
p_interface_rec.Group_id,
p_interface_rec.Export_file,
p_interface_rec.Export_date,
p_interface_rec.Import_file,
p_interface_rec.Import_date,
p_interface_rec.Created_by,
p_interface_rec.Creation_date,
p_interface_rec.Last_updated_by,
p_interface_rec.Last_update_date,
p_interface_rec.Last_update_login,
p_interface_rec.Request_id,
p_interface_rec.Program_application_id,
p_interface_rec.Program_id,
p_interface_rec.Program_update_date,
p_interface_rec.Valid_flag); -- Added as a part of fix for Bug 5137813
Insert into igi_imp_iac_interface_ctrl(
book_type_code,
category_id,
created_by,
creation_date,
transfer_Status ,
last_updated_by,
last_update_date,
last_update_login)
Values(
p_book,
p_category_id,
fnd_global.user_id,
sysdate,
'N' ,
fnd_global.user_id,
sysdate,
fnd_global.login_id);
Select bk.last_period_counter book_last_per_counter,
dp1.fiscal_year book_per_fiscal_year,
ict.corp_book corp_book,
ict.period_counter -1 corp_last_per_counter,
dp2.fiscal_year corp_per_fiscal_year,
dp2.period_num corp_curr_period_num
From igi_imp_iac_controls ict,
fa_book_controls bk,
fa_deprn_periods dp1,
fa_deprn_periods dp2
Where ict.book_type_code = p_book_type_code
and bk.book_type_code = ict.book_type_code
and dp1.book_type_code = ict.book_type_code
and dp1.period_counter = bk.last_period_counter + 1
and dp2.book_type_code = ict.corp_book
and dp2.period_counter = ict.period_counter;
Select sum(number_of_units_assigned) units,
nvl(sum(asset_cost),0) asset_cost,
nvl(sum(accumulated_depreciation),0) accumulated_depreciation,
nvl(sum(prior_yrs_accum_depreciation),0) prior_yrs_accum_depreciation,
nvl(sum(ytd_depreciation_reserve),0) ytd_depreciation_reserve,
nvl(sum(curr_mhc_prd_backlog_deprn),0) curr_mhc_prd_backlog_deprn,
nvl(sum(accumulated_backlog_deprn),0) accumulated_backlog_deprn,
nvl(sum(net_book_value),0) net_book_value,
nvl(sum(revaluation_reserve),0) revaluation_reserve,
nvl(sum(depreciation_expense),0) depreciation_expense,
nvl(sum(curr_yr_prior_prds_deprn),0) curr_yr_prior_prds_deprn,
nvl(sum(curr_yr_prior_prds_deprn_reval) ,0) curr_yr_prior_prds_deprn_reval,
nvl(sum(prior_year_operating_expense),0) prior_year_operating_expense,
nvl(sum(general_fund),0) general_fund,
nvl(sum(accumulated_general_fund),0) accumulated_general_fund
From igi_mhc_revaluation_detail
Where book_type_code = p_book
And period_counter = p_period_counter
And asset_id = p_asset_id
And reval_mode = 'INDEXED'
And active_flag= 'Y'
And Run_mode = 'L'
Group by asset_id;
Select max(period_counter) period_counter
From igi_mhc_revaluation_summary
Where book_type_code = p_book
and asset_id = p_asset_id
and reval_mode = 'INDEXED'
and active_flag= 'Y'
and run_mode = 'L';
Select nvl(original_cost,0) original_cost,
nvl(new_asset_cost,0) new_asset_cost,
nvl(new_salvage_value,0) new_salvage_value,
original_life,
current_life,
nvl(old_accum_deprn,0) old_accum_deprn,
nvl(new_accum_deprn,0) new_accum_deprn,
nvl(old_reval_reserve,0) old_reval_reserve,
nvl(new_reval_reserve,0) new_reval_reserve,
nvl(new_curr_yr_expense,0) new_curr_yr_expense,
nvl(new_backlog_deprn,0) new_backlog_deprn
From igi_mhc_revaluation_summary
Where book_type_code = p_book
and period_counter = p_period_counter
and asset_id = p_asset_id
and reval_mode = 'INDEXED'
and active_flag= 'Y'
and Run_mode = 'L';
Select igi_imp_iac_interface_group_s.nextval
Into l_group_id
From dual;
l_imp_interface.selected_Flag := 'N';
l_imp_interface.last_updated_by := fnd_global.user_id;
l_imp_interface.last_update_date := sysdate;
l_imp_interface.last_update_login := fnd_global.login_id;
l_imp_interface.program_update_date := sysdate;
SELECT period_counter, deprn_reserve, ytd_deprn
FROM fa_deprn_summary
WHERE book_type_code = p_corp_book
AND asset_id = p_asset_id
AND deprn_source_code = 'BOOKS';
Select
Asset_id,
Asset_number,
Book_type_code,
Category_id,
Period_counter,
Net_book_value,
Adjusted_cost,
Operating_acct,
Reval_reserve,
Deprn_amount,
Deprn_reserve,
Backlog_deprn_reserve,
General_fund,
Hist_cost,
Hist_deprn_expense,
Hist_ytd,
Hist_accum_deprn,
Hist_life_in_months,
Hist_nbv,
Hist_salvage_value,
General_fund_Periodic,
Operating_account_ytd,
cummulative_reval_factor,
current_reval_factor
From igi_imp_iac_interface_py_add
Where book_type_code = p_book
and category_id = p_category_id
and asset_id = p_asset_id;
Select igi_imp_iac_interface_group_s.nextval
Into l_group_id
From dual;
Select max(Period_counter)
Into l_Corp_last_per_counter
From fa_deprn_summary
Where book_type_code = p_corp_book
and asset_id = C_Book_Info_Rec.asset_id;
l_imp_interface.Selected_flag := 'Y';
l_imp_interface.Last_Updated_by := fnd_global.user_id;
l_imp_interface.Last_Update_date := sysdate;
l_imp_interface.Last_update_login := fnd_global.login_id;
l_imp_interface.Program_update_date := sysdate;