DBA Data[Home] [Help]

APPS.FA_RETIRE_PKG SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 36

     SELECT count(*)
     INTO LV_Count
     FROM FA_MASS_ADDITIONS
     WHERE BOOK_TYPE_CODE = X_Book_Type_Code
     AND ADD_TO_ASSET_ID = X_Asset_Id
     AND POSTING_STATUS NOT IN ('POSTED','MERGED','SPLIT','DELETE');
Line: 48

     SELECT count(*)
     INTO LV_Count
     FROM FA_RETIREMENTS
     WHERE ASSET_ID = X_Asset_Id
     AND BOOK_TYPE_CODE = X_Book_Type_Code
     AND STATUS IN ('PENDING','REINSTATE');
Line: 60

     SELECT
	     bk.cost,
	     bk.date_placed_in_service,
 	     bk.period_counter_fully_retired,
	     ah.units,
	     ah.category_id,
	     ah.asset_type,
	     greatest(least(dp.calendar_period_close_date, sysdate),
		     dp.calendar_period_open_date),
	     dp.period_counter,
	     dp.calendar_period_close_date,
	     ad.unit_adjustment_flag
     INTO
	     X_Cost,
	     LV_Date_Placed_In_Service,
	     LV_PC_Fully_Retired,
	     X_Current_Units,
	     LV_Category_Id,
	     X_Asset_Type,
	     X_Date_Retired,
	     X_Current_Period_Counter,
	     X_Calendar_Period_Close_Date,
	     LV_Unit_Adjustment_Flag
     FROM
	     fa_books bk,
	     fa_asset_history ah,
	     fa_deprn_periods dp,
	     fa_additions ad
     WHERE
	     bk.book_type_code = X_Book_Type_Code and
	     bk.asset_id = X_Asset_Id and
	     bk.date_ineffective is null
     and
	     ah.asset_id = X_Asset_Id and
	     ah.date_ineffective is null
     and
	     dp.book_type_code = X_Book_Type_Code and
	     dp.period_close_Date is null
     and
	     ad.asset_id = X_Asset_Id;
Line: 111

     SELECT current_fiscal_year,book_class,fiscal_year_name
     INTO X_Current_Fiscal_Year,X_Book_Class,LV_Fiscal_Year_Name
     FROM fa_book_controls
     WHERE book_type_code = X_Book_Type_Code;
Line: 116

     SELECT start_date, end_date
     INTO X_FY_Start_Date, X_FY_End_Date
     FROM FA_FISCAL_YEAR
     WHERE Fiscal_Year = X_Current_Fiscal_Year
     AND Fiscal_Year_Name = LV_Fiscal_Year_Name;
Line: 122

     SELECT dp.period_counter
     INTO X_Asset_Added_PC
     FROM FA_TRANSACTION_HEADERS TH,
     FA_DEPRN_PERIODS DP
     WHERE  TH.ASSET_ID = X_ASSET_ID
     AND    TH.BOOK_TYPE_CODE = X_BOOK_TYPE_CODE
     AND    TH.TRANSACTION_TYPE_CODE||'' =
	     DECODE(X_Book_Class,'CORPORATE','TRANSFER IN', 'ADDITION')
     AND    TH.DATE_EFFECTIVE BETWEEN DP.PERIOD_OPEN_DATE
     AND    NVL(DP.PERIOD_CLOSE_DATE, SYSDATE)
     AND    DP.BOOK_TYPE_CODE = X_BOOK_TYPE_CODE;
Line: 136

     /*SELECT max(transaction_date_entered)
     INTO X_Max_Transaction_Date_Entered
     FROM fa_transaction_headers
     WHERE asset_id = X_Asset_Id
     and book_type_code = X_Book_Type_Code
     and transaction_type_code not in ('REINSTATEMENT','FULL RETIREMENT')
     and transaction_type_code not like '%/VOID';*/  -- bug2107509
Line: 155

     SELECT retirement_prorate_convention,
	     use_stl_retirements_flag,
	     stl_method_code,
	     stl_life_in_months
     INTO	X_Ret_Prorate_Convention,
	     X_Use_STL_Retirements_Flag,
	     X_STL_Method_Code,
	     X_STL_Life_In_Months
     FROM	fa_category_book_defaults
     WHERE	book_type_code = X_Book_Type_Code
     and	category_id = LV_Category_Id
     and 	LV_Date_Placed_In_Service between start_dpis and
		     nvl(end_dpis,LV_Date_Placed_In_Service);