102: -- Use the existing function in FA_ASSET_RECLASS_PKG.
103: SELECT count(*)
104: INTO l_is_retired
105: FROM FA_BOOKS BK,
106: FA_BOOK_CONTROLS BC
107: WHERE
108: BK.ASSET_ID = p_asset_id AND
109: BK.PERIOD_COUNTER_FULLY_RETIRED IS NOT NULL AND
110: BK.DATE_INEFFECTIVE IS NULL AND
202:
203: -- Make sure the new category is defined in all the books the asset belongs to.
204: -- Get the number of books in which the new category is defined for the asset.
205: SELECT count(*) INTO l_check_count1
206: FROM FA_CATEGORY_BOOKS cb, FA_BOOKS bk, fa_book_controls bc
207: WHERE bk.asset_id = p_asset_id
208: AND bk.date_ineffective IS NULL
209: AND bk.book_type_code = cb.book_type_code
210: AND cb.category_id = p_new_category_id
212: AND nvl(bc.date_ineffective,sysdate) >= sysdate;
213:
214: -- Get the total number of books the asset belongs to.
215: SELECT count(*) INTO l_check_count2
216: FROM FA_BOOKS bk, FA_BOOK_CONTROLS bc
217: WHERE bk.asset_id = p_asset_id
218: AND bk.date_ineffective IS NULL
219: AND bk.book_type_code = bc.book_type_code
220: AND nvl(bc.date_ineffective,sysdate) >= sysdate;