INFO: Project Accounting main tables

GL_JE_BATCHES, STATUS = 'P', means "Posted".
GL_JE_BATCHES, STATUS = 'U', means unposted.
GL_JE_BATCHES, STATUS = 'S' mean "Selecting".
GL_JE_BATCHES, STATUS = 'A' implies "Funds reservation fails"

Query : List the orders that have failed in transaction

select order_number
from oks_reprocessing a
where a.success_flag = 'E' and order_number not in (Select nvl(source_header_ref,'11111') from csi_txn_errors)

How: Need to Update

SELECT a.asset_number,
b.life_in_months LIFE_IN_BOOKS,
m.asset_number,
m.attribute1 LIFE_IN_MASS_ADD
FROM fa_additions a,
fa_books b,
fa_mass_additions m
WHERE a.asset_id = b.asset_id
AND a.asset_number = m.asset_number
AND b.book_type_code LIKE 'BOOK NAME' --- pass the book
AND m.attribute1 IS NOT NULL

once you get , you need to take count
SELECT COUNT(*)
FROM fa_additions a,
fa_books b,
fa_mass_additions m
WHERE a.asset_id = b.asset_id
AND a.asset_number = m.asset_number
AND b.book_type_code LIKE 'BOOK NAME' --- pass the book
AND m.attribute1 IS NOT NULL

and finally here is your scripts for Update
UPDATE fa_books b
SET life_in_months = (
SELECT m.attribute1
FROM fa_mass_additions m, fa_additions a
WHERE a.asset_id = b.asset_id
AND a.asset_number = m.asset_number
AND m.book_type_code LIKE 'BOOK NAME' --- pass the book
AND m.attribute1 IS NOT NULL)
WHERE b.book_type_code LIKE 'BOOK NAME' --- pass the book