The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT cia.fa_asset_id,
cia.fa_book_type_code
FROM csi_item_instances cii,
csi_i_assets cia
WHERE cii.instance_id = cia.instance_id
AND cii.inventory_item_id = NVL(pc_asset_group_id,pc_rebuild_item_id)
AND cii.instance_number = NVL(pc_asset_number, pc_rebuild_serial_number)
AND cia.asset_quantity > 0
AND cia.update_status = 'IN_SERVICE';
SELECT fa.asset_category_id,
fa.asset_number,
fa.in_use_flag
FROM fa_additions_b fa
WHERE asset_id = pc_fixed_asset_id;
SELECT END_DATE
FROM FA_CALENDAR_PERIODS FAP,
fa_book_controls FAC
WHERE FAP.calendar_type=c_calendar_type
AND FAC.BOOk_TYPE_CODE =c_book_type_code
AND FAP.PERIOD_NAME=c_period_name;
Select dp.period_name,
bc.last_deprn_run_date,
bc.deprn_calendar
from fa_deprn_periods dp,
fa_deprn_periods dp2,
fa_deprn_periods dp3,
fa_book_controls bc
where dp.book_type_code =c_book_type_code
and dp.period_close_date is null
and dp2.book_type_code(+) = bc.distribution_source_book
and dp2.period_counter(+) = bc.last_mass_copy_period_counter
and dp3.book_type_code(+) = bc.book_type_code
and dp3.period_counter(+) = bc.last_purge_period_counter
and bc.book_type_code = c_book_type_code;
SELECT fa_mass_additions_s.nextval
INTO l_mass_addition_id
FROM SYS.DUAL ;
INSERT INTO fa_mass_additions
(mass_addition_id,
add_to_asset_id,
asset_category_id,
book_type_code,
fixed_assets_cost,
feeder_system_name,
posting_status,
queue_name,
transaction_date, -- Bug 6640036
transaction_type_code,
in_use_flag,
reviewer_comments,
payables_code_combination_id,
payables_cost,
merged_code,
MERGE_PARENT_MASS_ADDITIONS_ID, -- Bug 7678186
CREATED_BY,
CREATION_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_DATE,
LAST_UPDATE_LOGIN
)
VALUES
(l_mass_addition_id,
l_fa_asset_id,
l_post_asset_category_id,
l_book_type_code,
p_eam_wo_bills_tbl(i).billed_amount, -- Add to table will be passed in from form
'ENTERPRISE ASSET MANAGEMENT',
decode(l_fa_asset_id, null, l_posting_status,'POST'),
decode(l_fa_asset_id, null, l_queue_name,'ADD TO ASSET'), --Added decode for CU Project
l_transaction_date, -- Bug 6640036
l_transaction_type_code, --Bug 6640036
nvl(l_in_use_flag,'N'),
p_eam_wo_bills_tbl(i).comments,
p_eam_wo_bills_tbl(i).offset_account_ccid, -- Offset/Clearance Account
p_eam_wo_bills_tbl(i).billed_amount, -- To credit Clearance A/C with this amount
l_merged_code,
l_merge_parent_id,
fnd_global.user_id,
sysdate,
fnd_global.user_id,
sysdate,
fnd_global.user_id);
INSERT INTO eam_work_order_bills(
organization_id,
wip_entity_id,
operation_seq_num,
inventory_item_id,
resource_id,
billed_inventory_item_id,
billed_uom_code,
billed_quantity,
cost_or_listprice,
costplus_percentage,
billed_amount,
billing_method,
fixed_asset_number,
mass_addition_id,
capitalization_date,
comments,
offset_account_ccid,
CREATED_BY,
CREATION_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_DATE,
LAST_UPDATE_LOGIN )
VALUES (
p_eam_wo_bills_tbl(i).organization_id,
p_eam_wo_bills_tbl(i).wip_entity_id,
p_eam_wo_bills_tbl(i).operation_seq_num,
p_eam_wo_bills_tbl(i).billed_inventory_item_id,
p_eam_wo_bills_tbl(i).resource_id,
nvl(p_eam_wo_bills_tbl(i).billed_inventory_item_id,-123456),
p_eam_wo_bills_tbl(i).billed_uom_code,
p_eam_wo_bills_tbl(i).billed_quantity,
l_cost,
p_eam_wo_bills_tbl(i).COSTPLUS_PERCENTAGE, -- = as entered by the user
p_eam_wo_bills_tbl(i).billed_amount, -- = Calculated Amount
3, -- (Capitalzation)
l_fa_asset_id,
l_mass_addition_id,
sysdate,
p_eam_wo_bills_tbl(i).comments,
p_eam_wo_bills_tbl(i).offset_account_ccid,
fnd_global.user_id,
sysdate,
fnd_global.user_id,
sysdate,
fnd_global.user_id);
SELECT cost
INTO l_cost
FROM fa_books
WHERE transaction_header_id_out IS NULL
AND asset_id = l_asset_id
AND book_type_code = l_book_type_code;
SELECT ood.operating_unit
INTO l_txn_ou_context
FROM org_organization_definitions ood
WHERE ood.organization_id = l_org_id
AND ROWNUM = 1;
select asset_category_id
into l_post_asset_category_id
from mtl_system_items_b
where inventory_item_id = l_inventory_item_id
and organization_id = l_org_id;