The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT bc.book_type_code,
bc.book_class,
bc.accounting_flex_structure,
bc.distribution_source_book,
sob.currency_code,
cur.precision
INTO l_book,
l_book_class,
l_accounting_flex_Structure,
l_distribution_source_book,
l_currency_code,
l_precision
FROM FA_BOOK_CONTROLS bc,
GL_SETS_OF_BOOKS sob,
FND_CURRENCIES cur
WHERE bc.book_type_code = P_BOOK
AND sob.set_of_books_id = bc.set_of_books_id
AND sob.currency_code = cur.currency_code;
SELECT period_name,
period_counter,
period_open_date,
nvl(period_close_date, sysdate),
fiscal_year
INTO l_period_name,
l_period_PC,
l_period_POD,
l_period_PCD,
l_period_FY
FROM FA_DEPRN_PERIODS
WHERE book_type_code = P_BOOK
AND period_name = P_PERIOD1;
SELECT cr.concurrent_program_id
INTO l_conc_program_id
FROM FND_CONCURRENT_REQUESTS cr
WHERE cr.program_application_id = 140
AND cr.request_id = P_CONC_REQUEST_ID;
SELECT cp.user_concurrent_program_name
INTO l_report_name
FROM FND_CONCURRENT_PROGRAMS_VL cp
WHERE
cp.concurrent_program_id= l_conc_program_id
and cp.application_id = 140;
SELECT period_name,
period_counter,
period_open_date,
nvl(period_close_date, sysdate),
fiscal_year
INTO l_period_name,
l_period_PC,
l_period_POD,
l_period_PCD,
l_period_FY
FROM FA_DEPRN_PERIODS
WHERE book_type_code = P_BOOK
AND period_name = P_PERIOD2;
select MEANING
into l_meaning
from FA_LOOKUPS
where LOOKUP_TYPE = 'GAINLOSS'
and LOOKUP_CODE = 'GAIN';
select MEANING
into l_meaning
from FA_LOOKUPS
where LOOKUP_TYPE = 'GAINLOSS'
and LOOKUP_CODE = 'LOSS';
select rate_source_rule
from fa_methods
where method_code = l_method_code;
select period_num, cp.start_date, fiscal_year_name
from fa_calendar_periods cp,
fa_book_controls bc
where calendar_type = bc.deprn_calendar
and bc.book_type_code = x_book
and start_date >= previous_end_date
order by start_date;
SELECT decode (mt.rate_source_rule,
'CALCULATED', bk.prorate_date,
'FORMULA', bk.prorate_date,
'TABLE', bk.deprn_start_date,
'FLAT', decode (mt.deprn_basis_rule,
'COST', bk.prorate_date,
'NBV', bk.deprn_start_date),
'PROD', bk.date_placed_in_service),
to_number (to_char (bk.prorate_date, 'J')),
to_number (to_char (bk.date_placed_in_service, 'J')),
to_number (to_char (bk.deprn_start_date, 'J')),
nvl(bk.life_in_months, 0),
bk.recoverable_cost,
bk.adjusted_cost,
bk.cost,
nvl(bk.reval_amortization_basis, 0),
bk.rate_adjustment_factor,
nvl(bk.adjusted_rate, 0),
bk.ceiling_name,
bk.bonus_rule,
nvl (bk.production_capacity, 0),
nvl (bk.adjusted_capacity, 0),
mt.method_code,
ad.asset_number,
nvl (bk.adjusted_recoverable_cost, bk.recoverable_cost),
bk.salvage_value,
bk.period_counter_life_complete,
bk.annual_deprn_rounding_flag,
bk.itc_amount_id,
bk.itc_basis,
ceilt.ceiling_type,
nvl(bk.formula_factor, 1),
nvl(bk.short_fiscal_year_flag, 'NO'),
bk.conversion_date,
bk.original_deprn_start_date,
bk.prorate_date,
to_number(to_char(bk.prorate_date,'YYYY')),
bk.date_placed_in_service,
ret.cost_retired,
ret.date_retired,
to_number(to_char(ret.date_retired,'YYYY')),
th.transaction_type_code
FROM fa_ceiling_types ceilt,
fa_methods mt,
fa_category_books cb,
fa_books bk,
fa_retirements ret,
fa_transaction_headers th,
fa_additions ad
WHERE cb.book_type_code = X_book
AND ad.asset_category_id = cb.category_id
AND ceilt.ceiling_name(+) = bk.ceiling_name
AND mt.method_code = bk.deprn_method_code
AND bk.book_type_code = X_book
AND bk.asset_id = X_asset_id
AND bk.transaction_header_id_out = th.transaction_header_id
AND ret.status = 'PROCESSED'
AND th.transaction_type_code in ('FULL RETIREMENT','PARTIAL RETIREMENT')
AND ret.transaction_header_id_in = th.transaction_header_id
AND nvl (mt.life_in_months, -9999) =
nvl (bk.life_in_months, -9999)
AND ad.asset_id = bk.asset_id
ORDER BY th.transaction_header_id;
select deprn_reserve, ytd_deprn, bk.date_placed_in_service, bk.deprn_method_code
into dpr_in.deprn_rsv, dpr_in.ytd_deprn, l_main_dpis, l_method_code
from fa_deprn_summary ds,
fa_books bk,
fa_transaction_headers th
where ds.book_type_code = X_book
and ds.asset_id = X_asset_id
and ds.deprn_source_code = 'BOOKS'
and th.transaction_header_id = bk.transaction_header_id_in
and th.transaction_header_id in (select max(transaction_header_id)
from fa_transaction_headers thsub
where transaction_type_code like '%RETIREMENT'
and book_type_code = x_book
and asset_id = x_asset_id)
;
select bc.deprn_calendar,
bc.fiscal_year_name,
ct.number_per_fiscal_year
into h_calendar_type, h_fy_name, h_num_per_fy
from fa_book_controls bc, fa_calendar_types ct
where bc.book_type_code = X_book
and bc.deprn_calendar = ct.calendar_type;
select period_num
into dpr_in.p_cl_begin
from fa_calendar_periods cp,
fa_book_controls bc
where calendar_type = bc.deprn_calendar
and bc.book_type_code = x_book
and dpr_in.prorate_date
between cp.start_date and cp.end_date;
select max(period_num)
into dpr_in.p_cl_end
from fa_deprn_periods
where book_type_code = X_book;
select period_num
into dpr_in.p_cl_end
from fa_calendar_periods cp,
fa_book_controls bc
where calendar_type = bc.deprn_calendar
and bc.book_type_code = x_book
and l_date_retired
between cp.start_date and cp.end_date;
select fiscal_year
into dpr_in.y_begin
from fa_fiscal_year
where fiscal_year_name = l_fiscal_year_name
and l_start_date between start_date and end_date;
select period_num
into dpr_in.p_cl_end
from fa_calendar_periods cp,
fa_book_controls bc
where calendar_type = bc.deprn_calendar
and bc.book_type_code = x_book
and to_date('19611231','YYYYMMDD')
between cp.start_date and cp.end_date;
select period_num
into dpr_in.p_cl_end
from fa_calendar_periods cp,
fa_book_controls bc
where calendar_type = bc.deprn_calendar
and bc.book_type_code = x_book
and l_date_retired
between cp.start_date and cp.end_date;