The following lines contain the word 'select', 'insert', 'update' or 'delete':
select /*+ leading(th) rowid(th) */
th.transaction_header_id ,
th.asset_id ,
th.book_type_code ,
th.transaction_type_code ,
bk.cost ,
ad.asset_category_id ,
ad.asset_type ,
ad.current_units ,
bc.set_of_books_id
from fa_transaction_headers th,
fa_deprn_periods dp,
fa_books bk,
fa_category_books cb,
fa_additions_b ad,
fa_book_controls bc
where th.rowid between p_start_rowid and p_end_rowid
and th.book_type_code = dp.book_type_code
and th.date_effective > dp.period_open_date
and dp.period_close_date is null
and dp.book_type_code = bc.book_type_code
and bc.book_class <> 'BUDGET'
and nvl(bc.date_ineffective, sysdate + 1) > sysdate
and bc.book_type_code = cb.book_type_code
and ad.asset_category_id = cb.category_id
and th.transaction_type_code in ('ADDITION', 'CIP ADDITION')
and th.transaction_header_id = bk.transaction_header_id_in
and bk.cost <> 0
and th.asset_id = ad.asset_id
and not exists (select 'x'
from fa_adjustments aj
where aj.asset_id = th.asset_id
and aj.book_type_code = th.book_type_code
and aj.transaction_header_id = th.transaction_header_id
and aj.adjustment_type like '%COST');
select AI.Payables_Code_Combination_ID,
NVL(AI.Payables_Cost, 0),
AI.Asset_Invoice_ID,
AI.source_line_id
FROM FA_ASSET_INVOICES AI
WHERE AI.ASSET_ID = p_asset_id
AND AI.Payables_Code_Combination_ID IS NOT NULL
AND AI.Date_Ineffective IS NULL
ORDER BY AI.Payables_Code_Combination_ID,
AI.PO_Vendor_ID,
AI.Invoice_Number;
l_clearing_to_insert number := 0;
l_trans_rec.who_info.last_update_date := sysdate;
l_trans_rec.who_info.last_updated_by := c_upgrade_bugno;
l_trans_rec.who_info.last_update_login := c_upgrade_bugno;
l_adj.selection_mode := FA_ADJUST_TYPE_PKG.FA_AJ_ACTIVE;
l_adj.selection_thid := 0;
l_adj.selection_retid := 0;
l_adj.last_update_date :=
l_trans_rec.who_info.last_update_date;
l_trans_rec.who_info.last_update_date,
l_trans_rec.who_info.last_updated_by,
l_trans_rec.who_info.last_update_login,
l_log_level_rec) then
raise error_found;
l_clearing_to_insert := l_cost(i) - l_sum_payables_cost;
p_clearing => l_clearing_to_insert,
p_deprn_expense => 0,
p_bonus_expense => 0,
p_impair_expense => 0,
p_ann_adj_amt => 0,
p_mrc_sob_type_code => l_mrc_sob_type_code,
p_calling_fn => l_calling_fn,
p_log_level_rec => l_log_level_rec
) then
raise error_found;
update fa_transaction_headers
set event_id = -2
where transaction_header_id = l_adj.transaction_header_id
and asset_id = l_adj.asset_id
and book_type_code = l_adj.book_type_code;
l_trans_rec.who_info.last_update_date,
l_trans_rec.who_info.last_updated_by,
l_trans_rec.who_info.last_update_login,
l_log_level_rec) then
raise error_found;
l_thid.delete;
l_asset_id.delete;
l_book_type_code.delete;
l_trx_type_code.delete;
l_cost.delete;
l_category_id.delete;
l_asset_type.delete;
l_current_units.delete;
l_set_of_books_id.delete;
l_payables_ccid.delete;
l_payables_cost.delete;
l_asset_invoice_id.delete;
l_source_line_id.delete;
select /*+ leading(th) rowid(th) */
th.transaction_header_id ,
th.asset_id ,
th.book_type_code ,
th.transaction_type_code ,
bk.cost ,
ad.asset_category_id ,
ad.asset_type ,
ad.current_units ,
mcbc.set_of_books_id
from fa_transaction_headers th,
fa_mc_deprn_periods dp,
fa_mc_books bk,
fa_additions_b ad,
fa_category_books cb,
fa_book_controls bc,
fa_mc_book_controls mcbc
where th.rowid between p_start_rowid and p_end_rowid
and th.book_type_code = dp.book_type_code
and th.date_effective > dp.period_open_date
and dp.period_close_date is null
and dp.book_type_code = bc.book_type_code
and bc.book_class <> 'BUDGET'
and nvl(bc.date_ineffective, sysdate + 1) > sysdate
and bc.book_type_code = cb.book_type_code
and ad.asset_category_id = cb.category_id
and dp.book_type_code = mcbc.book_type_code
and dp.set_of_books_id = mcbc.set_of_books_id
and th.transaction_type_code in ('ADDITION', 'CIP ADDITION')
and th.transaction_header_id = bk.transaction_header_id_in
and bk.set_of_books_id = mcbc.set_of_books_id
and bk.book_type_code = mcbc.book_type_code
and mcbc.enabled_flag = 'Y'
and bk.cost <> 0
and th.asset_id = ad.asset_id
and not exists (select 'x'
from fa_mc_adjustments aj
where aj.asset_id = th.asset_id
and aj.book_type_code = th.book_type_code
and aj.set_of_books_id = mcbc.set_of_books_id
and aj.book_type_code = mcbc.book_type_code
and aj.transaction_header_id = th.transaction_header_id
and aj.adjustment_type like '%COST')
order by set_of_books_id;
select AI.Payables_Code_Combination_ID,
NVL(AI.Payables_Cost, 0),
AI.Asset_Invoice_ID,
AI.source_line_id
FROM FA_MC_ASSET_INVOICES AI
WHERE AI.ASSET_ID = p_asset_id
AND AI.set_of_books_id = p_set_of_books_id
AND AI.Payables_Code_Combination_ID IS NOT NULL
AND AI.Date_Ineffective IS NULL
ORDER BY AI.Payables_Code_Combination_ID,
AI.PO_Vendor_ID,
AI.Invoice_Number;
l_clearing_to_insert number := 0;
l_trans_rec.who_info.last_update_date := sysdate;
l_trans_rec.who_info.last_updated_by := c_upgrade_bugno;
l_trans_rec.who_info.last_update_login := c_upgrade_bugno;
l_adj.selection_mode := FA_ADJUST_TYPE_PKG.FA_AJ_ACTIVE;
l_adj.selection_thid := 0;
l_adj.selection_retid := 0;
l_adj.last_update_date := l_trans_rec.who_info.last_update_date;
l_trans_rec.who_info.last_update_date,
l_trans_rec.who_info.last_updated_by,
l_trans_rec.who_info.last_update_login,
l_log_level_rec) then
raise error_found;
l_clearing_to_insert := l_cost(i) - l_sum_payables_cost;
p_clearing => l_clearing_to_insert,
p_deprn_expense => 0,
p_bonus_expense => 0,
p_impair_expense => 0,
p_ann_adj_amt => 0,
p_mrc_sob_type_code => l_mrc_sob_type_code,
p_calling_fn => l_calling_fn,
p_log_level_rec => l_log_level_rec
) then
raise error_found;
l_trans_rec.who_info.last_update_date,
l_trans_rec.who_info.last_updated_by,
l_trans_rec.who_info.last_update_login,
l_log_level_rec) then
raise error_found;
l_thid.delete;
l_asset_id.delete;
l_book_type_code.delete;
l_trx_type_code.delete;
l_cost.delete;
l_category_id.delete;
l_asset_type.delete;
l_current_units.delete;
l_set_of_books_id.delete;
l_payables_ccid.delete;
l_payables_cost.delete;
l_asset_invoice_id.delete;
l_source_line_id.delete;
select /*+ leading(th) rowid(th) swap_join_inputs(bc) */
th.transaction_header_id,
th.asset_id,
th.book_type_code,
bks.adjustment_required_status,
ad.asset_type,
ad.current_units,
ad.asset_category_id,
th.transaction_type_code,
bc.set_of_books_id,
th.transaction_subtype,
bks.group_asset_id,
bks.annual_deprn_rounding_flag,
th.transaction_date_entered,
th.transaction_name,
th.source_transaction_header_id,
th.transaction_key,
th.amortization_start_date,
bks.cost,
bks.adjusted_cost,
bks.recoverable_cost,
bks.reval_amortization_basis,
bks.adjusted_rate,
bks.production_capacity,
bks.adjusted_capacity,
bks.adjusted_recoverable_cost,
bks.deprn_method_code,
bks.life_in_months,
bks.salvage_value,
bks.depreciate_flag,
bks.ceiling_name,
bks.rate_adjustment_factor,
bks.bonus_rule,
bks.prorate_date,
bks.deprn_start_date,
bks.date_placed_in_service,
bks.short_fiscal_year_flag,
bks.conversion_date,
bks.original_deprn_start_date,
bks.formula_factor,
bks.eofy_reserve,
ad.asset_number,
ds.deprn_amount,
ds.ytd_deprn,
ds.deprn_reserve,
ds.prior_fy_expense,
ds.bonus_deprn_amount,
ds.bonus_ytd_deprn,
ds.prior_fy_bonus_expense,
ds.reval_amortization,
ds.reval_amortization_basis,
ds.reval_deprn_expense,
ds.ytd_reval_deprn_expense,
ds.reval_reserve,
ds.production,
ds.ytd_production,
ds.ltd_production
from fa_transaction_headers th,
fa_books bks,
fa_additions_b ad,
fa_book_controls bc,
fa_category_books cb,
fa_deprn_summary ds,
fa_deprn_periods dp
where th.rowid between p_start_rowid and p_end_rowid
and bc.book_type_code = th.book_type_code
and nvl(bc.date_ineffective, sysdate + 1) > sysdate
and bc.book_type_code = cb.book_type_code
and ad.asset_category_id = cb.category_id
and th.transaction_header_id = bks.transaction_header_id_in
and bks.transaction_header_id_out is null
and bks.adjustment_required_status in ('ADD', 'TFR')
and th.asset_id = ad.asset_id
and th.asset_id = ds.asset_id
and th.book_type_code = ds.book_type_code
and ds.deprn_source_code = 'BOOKS'
and dp.book_type_code = th.book_type_code
and dp.period_close_date is null
and th.date_effective between dp.period_open_date and sysdate;
select /*+ leading(th) rowid(th) swap_join_inputs(bc) */
th.transaction_header_id,
th.asset_id,
th.book_type_code,
bks.adjustment_required_status,
ad.asset_type,
ad.current_units,
ad.asset_category_id,
th.transaction_type_code,
mcbc.set_of_books_id,
th.transaction_subtype,
bks.group_asset_id,
bks.annual_deprn_rounding_flag,
th.transaction_date_entered,
th.transaction_name,
th.source_transaction_header_id,
th.transaction_key,
th.amortization_start_date,
bks.cost,
bks.adjusted_cost,
bks.recoverable_cost,
bks.reval_amortization_basis,
bks.adjusted_rate,
bks.production_capacity,
bks.adjusted_capacity,
bks.adjusted_recoverable_cost,
bks.deprn_method_code,
bks.life_in_months,
bks.salvage_value,
bks.depreciate_flag,
bks.ceiling_name,
bks.rate_adjustment_factor,
bks.bonus_rule,
bks.prorate_date,
bks.deprn_start_date,
bks.date_placed_in_service,
bks.short_fiscal_year_flag,
bks.conversion_date,
bks.original_deprn_start_date,
bks.formula_factor,
bks.eofy_reserve,
ad.asset_number,
ds.deprn_amount,
ds.ytd_deprn,
ds.deprn_reserve,
ds.prior_fy_expense,
ds.bonus_deprn_amount,
ds.bonus_ytd_deprn,
ds.prior_fy_bonus_expense,
ds.reval_amortization,
ds.reval_amortization_basis,
ds.reval_deprn_expense,
ds.ytd_reval_deprn_expense,
ds.reval_reserve,
ds.production,
ds.ytd_production,
ds.ltd_production
from fa_transaction_headers th,
fa_mc_books bks,
fa_additions_b ad,
fa_book_controls bc,
fa_category_books cb,
fa_mc_book_controls mcbc,
fa_mc_deprn_summary ds,
fa_mc_deprn_periods dp
where th.rowid between p_start_rowid and p_end_rowid
and bc.book_type_code = th.book_type_code
and nvl(bc.date_ineffective, sysdate + 1) > sysdate
and bc.book_type_code = cb.book_type_code
and ad.asset_category_id = cb.category_id
and bc.book_type_code = mcbc.book_type_code
and mcbc.enabled_flag = 'Y'
and mcbc.book_type_code = bks.book_type_code
and mcbc.set_of_books_id = bks.set_of_books_id
and mcbc.book_type_code = ds.book_type_code
and mcbc.set_of_books_id = ds.set_of_books_id
and th.transaction_header_id = bks.transaction_header_id_in
and bks.transaction_header_id_out is null
and bks.adjustment_required_status = 'ADD'
and th.asset_id = ad.asset_id
and th.asset_id = ds.asset_id
and th.book_type_code = ds.book_type_code
and ds.deprn_source_code = 'BOOKS'
and nvl(th.transaction_subtype, 'EXPENSED') <> 'AMORTIZED'
and ad.asset_type = 'CAPITALIZED'
and bks.group_asset_id is null
and nvl(bks.annual_deprn_rounding_flag, 'ADD') <> 'RES'
and dp.book_type_code = mcbc.book_type_code
and dp.set_of_books_id = mcbc.set_of_books_id
and dp.book_type_code = th.book_type_code
and dp.period_close_date is null
and th.date_effective between dp.period_open_date and sysdate;
select dh.distribution_id,
dh.units_assigned,
dh.transaction_units,
dh.assigned_to,
dh.code_combination_id,
dh.location_id
from fa_distribution_history dh
where dh.book_type_code = l_book_type_code
and dh.asset_id = l_asset_id
and dh.transaction_header_id_out = l_transaction_header_id
union all
select dh.distribution_id,
dh.units_assigned,
dh.transaction_units,
dh.assigned_to,
dh.code_combination_id,
dh.location_id
from fa_distribution_history dh
where dh.book_type_code = l_book_type_code
and dh.asset_id = l_asset_id
and dh.transaction_header_id_in = l_transaction_header_id;
l_trans_rec.who_info.last_update_date := sysdate;
l_trans_rec.who_info.last_updated_by := c_fnd_user;
l_trans_rec.who_info.last_update_login := c_upgrade_bugno;
fa_books_pkg.update_row
(X_asset_id => l_asset_hdr_rec.asset_id,
X_book_type_code => l_asset_hdr_rec.book_type_code,
X_Adjustment_Required_Status
=> 'NONE',
X_rate_adjustment_factor
=> l_asset_fin_rec.rate_adjustment_factor,
X_reval_amortization_basis
=>
l_asset_fin_rec.reval_amortization_basis,
X_adjusted_cost => l_asset_fin_rec.adjusted_cost,
X_adjusted_capacity => l_asset_fin_rec.adjusted_capacity,
X_formula_factor => l_asset_fin_rec.formula_factor,
X_eofy_reserve => l_asset_fin_rec.eofy_reserve,
X_mrc_sob_type_code => l_mrc_sob_type_code,
X_set_of_books_id => l_asset_hdr_rec.set_of_books_id,
X_calling_fn => l_calling_fn,
p_log_level_rec => l_log_level_rec
);
update fa_transaction_headers
set event_id = -2
where transaction_header_id = l_trans_rec.transaction_header_id
and asset_id = l_asset_hdr_rec.asset_id
and book_type_code = l_asset_hdr_rec.book_type_code;
l_asset_dist_tbl.delete;
fa_books_pkg.update_row
(X_asset_id => l_asset_hdr_rec.asset_id,
X_book_type_code => l_asset_hdr_rec.book_type_code,
X_Adjustment_Required_Status
=> 'NONE',
X_mrc_sob_type_code => 'P',
X_set_of_books_id => l_asset_hdr_rec.set_of_books_id,
X_calling_fn => l_calling_fn,
p_log_level_rec => l_log_level_rec
);
update fa_transaction_headers
set event_id = -2
where transaction_header_id = l_trans_rec.transaction_header_id
and asset_id = l_asset_hdr_rec.asset_id
and book_type_code = l_asset_hdr_rec.book_type_code;
l_asset_dist_tbl.delete;
l_transaction_header_id_tbl.delete;
l_asset_id_tbl.delete;
l_book_type_code_tbl.delete;
l_adj_req_status_tbl.delete;
l_asset_type_tbl.delete;
l_current_units_tbl.delete;
l_category_id_tbl.delete;
l_transaction_type_code_tbl.delete;
l_set_of_books_id_tbl.delete;
l_transaction_subtype_tbl.delete;
l_group_asset_id_tbl.delete;
l_ann_deprn_rounding_flag_tbl.delete;
l_transaction_date_entered_tbl.delete;
l_transaction_name_tbl.delete;
l_src_thid_tbl.delete;
l_transaction_key_tbl.delete;
l_amortization_start_date_tbl.delete;
l_cost_tbl.delete;
l_adjusted_cost_tbl.delete;
l_recoverable_cost_tbl.delete;
l_reval_amortization_basis_tbl.delete;
l_adjusted_rate_tbl.delete;
l_production_capacity_tbl.delete;
l_adjusted_capacity_tbl.delete;
l_adj_recoverable_cost_tbl.delete;
l_deprn_method_code_tbl.delete;
l_life_in_months_tbl.delete;
l_salvage_value_tbl.delete;
l_depreciate_flag_tbl.delete;
l_ceiling_name_tbl.delete;
l_rate_adjustment_factor_tbl.delete;
l_bonus_rule_tbl.delete;
l_prorate_date_tbl.delete;
l_deprn_start_date_tbl.delete;
l_date_placed_in_service_tbl.delete;
l_short_fiscal_year_flag_tbl.delete;
l_conversion_date_tbl.delete;
l_orig_deprn_start_date_tbl.delete;
l_formula_factor_tbl.delete;
l_eofy_reserve_tbl.delete;
l_asset_number_tbl.delete;
l_deprn_amount_tbl.delete;
l_ytd_deprn_tbl.delete;
l_deprn_reserve_tbl.delete;
l_prior_fy_expense_tbl.delete;
l_bonus_deprn_amount_tbl.delete;
l_bonus_ytd_deprn_tbl .delete;
l_prior_fy_bonus_expense_tbl.delete;
l_reval_amortization_tbl.delete;
l_reval_amortization_basis.delete;
l_reval_deprn_expense_tbl.delete;
l_reval_ytd_deprn_tbl.delete;
l_reval_deprn_reserve_tbl.delete;
l_production_tbl.delete;
l_ytd_production_tbl.delete;
l_ltd_production_tbl.delete;
select count(*)
into l_mrc_books
from fa_mc_book_controls
where enabled_flag = 'Y';
l_trans_rec.who_info.last_update_date := sysdate;
l_trans_rec.who_info.last_updated_by := c_fnd_user;
l_trans_rec.who_info.last_update_login := c_upgrade_bugno;
fa_books_pkg.update_row
(X_asset_id => l_asset_hdr_rec.asset_id,
X_book_type_code => l_asset_hdr_rec.book_type_code,
X_Adjustment_Required_Status
=> 'NONE',
X_rate_adjustment_factor
=> l_asset_fin_rec.rate_adjustment_factor,
X_reval_amortization_basis
=>
l_asset_fin_rec.reval_amortization_basis,
X_adjusted_cost => l_asset_fin_rec.adjusted_cost,
X_adjusted_capacity => l_asset_fin_rec.adjusted_capacity,
X_formula_factor => l_asset_fin_rec.formula_factor,
X_eofy_reserve => l_asset_fin_rec.eofy_reserve,
X_mrc_sob_type_code => l_mrc_sob_type_code,
X_set_of_books_id => l_asset_hdr_rec.set_of_books_id,
X_calling_fn => l_calling_fn,
p_log_level_rec => l_log_level_rec
);
l_asset_dist_tbl.delete;
l_transaction_header_id_tbl.delete;
l_asset_id_tbl.delete;
l_book_type_code_tbl.delete;
l_adj_req_status_tbl.delete;
l_asset_type_tbl.delete;
l_current_units_tbl.delete;
l_category_id_tbl.delete;
l_transaction_type_code_tbl.delete;
l_set_of_books_id_tbl.delete;
l_transaction_subtype_tbl.delete;
l_group_asset_id_tbl.delete;
l_ann_deprn_rounding_flag_tbl.delete;
l_transaction_date_entered_tbl.delete;
l_transaction_name_tbl.delete;
l_src_thid_tbl.delete;
l_transaction_key_tbl.delete;
l_amortization_start_date_tbl.delete;
l_cost_tbl.delete;
l_adjusted_cost_tbl.delete;
l_recoverable_cost_tbl.delete;
l_reval_amortization_basis_tbl.delete;
l_adjusted_rate_tbl.delete;
l_production_capacity_tbl.delete;
l_adjusted_capacity_tbl.delete;
l_adj_recoverable_cost_tbl.delete;
l_deprn_method_code_tbl.delete;
l_life_in_months_tbl.delete;
l_salvage_value_tbl.delete;
l_depreciate_flag_tbl.delete;
l_ceiling_name_tbl.delete;
l_rate_adjustment_factor_tbl.delete;
l_bonus_rule_tbl.delete;
l_prorate_date_tbl.delete;
l_deprn_start_date_tbl.delete;
l_date_placed_in_service_tbl.delete;
l_short_fiscal_year_flag_tbl.delete;
l_conversion_date_tbl.delete;
l_orig_deprn_start_date_tbl.delete;
l_formula_factor_tbl.delete;
l_eofy_reserve_tbl.delete;
l_asset_number_tbl.delete;
l_deprn_amount_tbl.delete;
l_ytd_deprn_tbl.delete;
l_deprn_reserve_tbl.delete;
l_prior_fy_expense_tbl.delete;
l_bonus_deprn_amount_tbl.delete;
l_bonus_ytd_deprn_tbl .delete;
l_prior_fy_bonus_expense_tbl.delete;
l_reval_amortization_tbl.delete;
l_reval_amortization_basis.delete;
l_reval_deprn_expense_tbl.delete;
l_reval_ytd_deprn_tbl.delete;
l_reval_deprn_reserve_tbl.delete;
l_production_tbl.delete;
l_ytd_production_tbl.delete;
l_ltd_production_tbl.delete;
select /*+ leading(th) rowid(th) */
adj.rowid,
ai.source_line_id,
mult.source_dest_code,
adj.asset_id,
adj.book_type_code,
adj.distribution_id,
adj.transaction_header_id,
adj.source_type_code,
adj.adjustment_type,
adj.debit_credit_flag,
adj.code_combination_id
from fa_transaction_headers th,
fa_book_controls bc,
fa_deprn_periods dp,
fa_adjustments adj,
fa_asset_invoices ai,
fa_invoice_transactions it,
(select 'SOURCE' source_dest_code from dual union all
select 'DEST' source_dest_code from dual) mult
where th.rowid between p_start_rowid and p_end_rowid
and bc.book_type_code = th.book_type_code
and nvl(bc.date_ineffective, sysdate + 1) > sysdate
and bc.book_type_code = dp.book_type_code
and dp.period_close_date is null
and th.date_effective > dp.period_open_date
and th.transaction_header_id = adj.transaction_header_id
and th.asset_id = adj.asset_id
and th.book_type_code = adj.book_type_code
and adj.asset_id = ai.asset_id
and adj.asset_invoice_id = ai.asset_invoice_id
and it.invoice_transaction_id =
decode(mult.source_dest_code,
'SOURCE', ai.invoice_transaction_id_out,
'DEST' , ai.invoice_transaction_id_in)
and th.invoice_transaction_id = it.invoice_transaction_id
and th.book_type_code = it.book_type_code
and it.transaction_type = 'INVOICE TRANSFER'
and adj.source_line_id is null;
select /*+ leading(th) rowid(th) */
adj.rowid,
mult.source_dest_code,
adj.asset_id,
adj.book_type_code,
adj.distribution_id,
adj.transaction_header_id,
adj.source_type_code,
adj.adjustment_type,
adj.debit_credit_flag,
adj.code_combination_id
from fa_transaction_headers th,
fa_book_controls bc,
fa_deprn_periods dp,
fa_adjustments adj,
fa_distribution_history dh,
(select 'SOURCE' source_dest_code from dual union all
select 'DEST' source_dest_code from dual) mult
where th.rowid between p_start_rowid and p_end_rowid
and bc.book_type_code = th.book_type_code
and nvl(bc.date_ineffective, sysdate + 1) > sysdate
and bc.book_type_code = dp.book_type_code
and dp.period_close_date is null
and th.date_effective > dp.period_open_date
and th.transaction_header_id = adj.transaction_header_id
and th.asset_id = adj.asset_id
and th.book_type_code = adj.book_type_code
and adj.asset_id = dh.asset_id
and adj.book_type_code = dh.book_type_code
and adj.distribution_id = dh.distribution_id
and adj.transaction_header_id =
decode (mult.source_dest_code,
'SOURCE', dh.transaction_header_id_out,
'DEST' , dh.transaction_header_id_in)
and adj.source_dest_code is null;
update fa_adjustments
set source_line_id = l_source_line_id_tbl(i),
source_dest_code = l_source_dest_code_tbl(i)
where rowid = l_adj_rowid_tbl(i);
update fa_mc_adjustments
set source_line_id = l_source_line_id_tbl(i),
source_dest_code = l_source_dest_code_tbl(i)
where asset_id = l_asset_id_tbl(i)
and book_type_code = l_book_type_code_tbl(i)
and distribution_id = l_distribution_id_tbl(i)
and transaction_header_id = l_transaction_header_id_tbl(i)
and source_type_code = l_source_type_code_tbl(i)
and adjustment_type = l_adjustment_type_tbl(i)
and debit_credit_flag = l_debit_credit_flag_tbl(i)
and code_combination_id = l_code_combination_id_tbl(i);
l_adj_rowid_tbl.delete;
l_source_line_id_tbl.delete;
l_asset_id_tbl.delete;
l_book_type_code_tbl.delete;
l_distribution_id_tbl.delete;
l_transaction_header_id_tbl.delete;
l_source_type_code_tbl.delete;
l_adjustment_type_tbl.delete;
l_debit_credit_flag_tbl.delete;
l_code_combination_id_tbl.delete;
update fa_adjustments
set source_dest_code = l_source_dest_code_tbl(i)
where rowid = l_adj_rowid_tbl(i);
update fa_mc_adjustments
set source_dest_code = l_source_dest_code_tbl(i)
where asset_id = l_asset_id_tbl(i)
and book_type_code = l_book_type_code_tbl(i)
and distribution_id = l_distribution_id_tbl(i)
and transaction_header_id = l_transaction_header_id_tbl(i)
and source_type_code = l_source_type_code_tbl(i)
and adjustment_type = l_adjustment_type_tbl(i)
and debit_credit_flag = l_debit_credit_flag_tbl(i)
and code_combination_id = l_code_combination_id_tbl(i);
l_adj_rowid_tbl.delete;
l_source_line_id_tbl.delete;
l_asset_id_tbl.delete;
l_book_type_code_tbl.delete;
l_distribution_id_tbl.delete;
l_transaction_header_id_tbl.delete;
l_source_type_code_tbl.delete;
l_adjustment_type_tbl.delete;
l_debit_credit_flag_tbl.delete;
l_code_combination_id_tbl.delete;