110:
111: SELECT count(*)
112: INTO l_is_retired
113: FROM FA_BOOKS BK,
114: FA_BOOK_CONTROLS BC
115: WHERE
116: BK.ASSET_ID = p_asset_id AND
117: BK.PERIOD_COUNTER_FULLY_RETIRED IS NOT NULL AND
118: BK.DATE_INEFFECTIVE IS NULL AND
214:
215: -- Make sure the new category is defined in all the books the asset belongs to.
216: -- Get the number of books in which the new category is defined for the asset.
217: SELECT count(*) INTO l_check_count1
218: FROM FA_CATEGORY_BOOKS cb, FA_BOOKS bk, fa_book_controls bc
219: WHERE bk.asset_id = p_asset_id
220: AND bk.date_ineffective IS NULL
221: AND bk.book_type_code = cb.book_type_code
222: AND cb.category_id = p_new_category_id
224: AND nvl(bc.date_ineffective,sysdate) >= sysdate;
225:
226: -- Get the total number of books the asset belongs to.
227: SELECT count(*) INTO l_check_count2
228: FROM FA_BOOKS bk, FA_BOOK_CONTROLS bc
229: WHERE bk.asset_id = p_asset_id
230: AND bk.date_ineffective IS NULL
231: AND bk.book_type_code = bc.book_type_code
232: AND nvl(bc.date_ineffective,sysdate) >= sysdate;