DBA Data[Home] [Help]

APPS.FA_WHATIF_DEPRN2_PKG SQL Statements

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

Line: 57

    select 'GL_CODE_COMBINATIONS' , c.table_id, g.application_column_name,
g.segment_num,	s.concatenated_segment_delimiter
    from fnd_columns c, fnd_id_flex_segments g, fnd_id_flex_structures s
    where g.application_id = 101
	  and g.id_flex_code = 'GL#'
	  and g.id_flex_num = (
		  select accounting_flex_structure
		  from fa_book_controls where book_type_code = X_book)
	  and g.enabled_flag = 'Y'
	  and c.application_id = g.application_id
	  and c.table_id = (select table_id
			    from fnd_tables
			    where table_name = 'GL_CODE_COMBINATIONS'
			    and application_id = 101)
	  and c.column_name = g.application_column_name
	  and s.application_id = g.application_id
       	  and s.id_flex_code = g.id_flex_code
          and s.id_flex_num = g.id_flex_num
    union -- asset key
    select 'FA_ASSET_KEYWORDS', c.table_id,g.application_column_name, g.segment_num, s.concatenated_segment_delimiter
    from fnd_columns c, fnd_id_flex_segments g, fnd_id_flex_structures s
    where g.application_id = 140
	  and g.id_flex_code = 'KEY#'
	  and g.id_flex_num = ( select asset_key_flex_structure
				from fa_system_controls)
	  and g.enabled_flag = 'Y'
	  and c.application_id = 140
	  and c.table_id = (select table_id
			    from fnd_tables
			    where table_name = 'FA_ASSET_KEYWORDS'
			    and application_id = 140)
	  and c.column_name = g.application_column_name
	  and s.application_id = g.application_id
       	  and s.id_flex_code = g.id_flex_code
          and s.id_flex_num = g.id_flex_num
     union -- location
     select 'FA_LOCATIONS', c.table_id, g.application_column_name, g.segment_num, s.concatenated_segment_delimiter
    from fnd_columns c, fnd_id_flex_segments g, fnd_id_flex_structures s
     where g.application_id = 140
	  and g.id_flex_code = 'LOC#'
	  and g.id_flex_num =  ( select location_flex_structure
				 from fa_system_controls)
	  and g.enabled_flag = 'Y'
	  and c.application_id = 140
	  and c.table_id = (select table_id
			    from fnd_tables
			    where table_name = 'FA_LOCATIONS'
			    and application_id = 140)
	  AND c.column_name = g.application_column_name
	  and s.application_id = g.application_id
       	  and s.id_flex_code = g.id_flex_code
          and s.id_flex_num = g.id_flex_num
     union -- category
     select 'FA_CATEGORIES_B', c.table_id, g.application_column_name, g.segment_num, s.concatenated_segment_delimiter
    from fnd_columns c, fnd_id_flex_segments g, fnd_id_flex_structures s
     where g.application_id = 140
	  and g.id_flex_code = 'CAT#'
	  and g.id_flex_num =   (select category_flex_structure
				 from fa_system_controls)
	  and g.enabled_flag = 'Y'
	  and c.application_id = 140
	  and c.table_id = (select table_id
			    from fnd_tables
			    where table_name = 'FA_CATEGORIES_B'
			    and application_id = 140)
	  and c.column_name = g.application_column_name
	  and s.application_id = g.application_id
       	  and s.id_flex_code = g.id_flex_code
          and s.id_flex_num = g.id_flex_num
	ORDER BY 1, 4;
Line: 137

  fa_whatif_deprn_pkg.t_request_id.delete;
Line: 138

  fa_whatif_deprn_pkg.t_book_type_code.delete;
Line: 139

  fa_whatif_deprn_pkg.t_asset_id.delete;
Line: 140

  fa_whatif_deprn_pkg.t_asset_number.delete;
Line: 141

  fa_whatif_deprn_pkg.t_description.delete;
Line: 142

  fa_whatif_deprn_pkg.t_tag_number.delete;
Line: 143

  fa_whatif_deprn_pkg.t_serial_number.delete;
Line: 144

  fa_whatif_deprn_pkg.t_period_name.delete;
Line: 145

  fa_whatif_deprn_pkg.t_fiscal_year.delete;
Line: 146

  fa_whatif_deprn_pkg.t_expense_acct.delete;
Line: 147

  fa_whatif_deprn_pkg.t_location.delete;
Line: 148

  fa_whatif_deprn_pkg.t_units.delete;
Line: 149

  fa_whatif_deprn_pkg.t_employee_name.delete;
Line: 150

  fa_whatif_deprn_pkg.t_employee_number.delete;
Line: 151

  fa_whatif_deprn_pkg.t_asset_key.delete;
Line: 152

  fa_whatif_deprn_pkg.t_current_cost.delete;
Line: 153

  fa_whatif_deprn_pkg.t_current_prorate_conv.delete;
Line: 154

  fa_whatif_deprn_pkg.t_current_method.delete;
Line: 155

  fa_whatif_deprn_pkg.t_current_life.delete;
Line: 156

  fa_whatif_deprn_pkg.t_current_basic_rate.delete;
Line: 157

  fa_whatif_deprn_pkg.t_current_adjusted_rate.delete;
Line: 158

  fa_whatif_deprn_pkg.t_current_salvage_value.delete;
Line: 159

  fa_whatif_deprn_pkg.t_depreciation.delete;
Line: 160

  fa_whatif_deprn_pkg.t_new_depreciation.delete;
Line: 161

  fa_whatif_deprn_pkg.t_created_by.delete;
Line: 162

  fa_whatif_deprn_pkg.t_creation_date.delete;
Line: 163

  fa_whatif_deprn_pkg.t_last_update_date.delete;
Line: 164

  fa_whatif_deprn_pkg.t_last_updated_by.delete;
Line: 165

  fa_whatif_deprn_pkg.t_last_update_login.delete;
Line: 166

  fa_whatif_deprn_pkg.t_date_placed_in_service.delete;
Line: 167

  fa_whatif_deprn_pkg.t_category.delete;
Line: 168

  fa_whatif_deprn_pkg.t_accumulated_deprn.delete;
Line: 169

  fa_whatif_deprn_pkg.t_bonus_depreciation.delete;
Line: 170

  fa_whatif_deprn_pkg.t_new_bonus_depreciation.delete;
Line: 171

  fa_whatif_deprn_pkg.t_current_bonus_rule.delete;
Line: 172

  fa_whatif_deprn_pkg.t_period_num.delete;
Line: 173

  fa_whatif_deprn_pkg.t_currency_code.delete;
Line: 183

    select amortize_flag into h_check from fa_book_controls
    where book_type_code = X_book;
Line: 203

  select location_flex_structure, category_flex_structure,
	asset_key_flex_structure
  into h_loc_struct, h_cat_struct, h_key_struct
  from fa_system_controls;
Line: 210

  select accounting_flex_structure into h_acct_struct
  from fa_book_controls where book_type_code = X_book;
Line: 216

  select cur.precision into h_precision
  from fa_book_controls bc, gl_sets_of_books sob, fnd_currencies cur
  where bc.book_type_code = X_book
  --and sob.set_of_books_id = bc.set_of_books_id
  and sob.set_of_books_id = FARX_C_WD.sob_id -- Enhancement bug 3037321
  and sob.currency_code = cur.currency_code;
Line: 224

    select fcr.last_update_login into h_login_id
    from fnd_concurrent_requests fcr
    where fcr.request_id = X_request_id;
Line: 251

	       fa_rx_shared_pkg.g_seg_table.delete;
Line: 318

	fa_whatif_deprn_pkg.g_deprn.delete;
Line: 380

         fa_whatif_deprn_pkg.g_deprn.delete;
Line: 395

    ret := fa_whatif_deprn_pkg.whatif_insert_itf (
	X_asset_id => X_assets(h_count),
	X_book	=> X_book,
	X_request_id => X_request_id,
	X_num_pers => X_num_per,
	X_acct_struct => h_acct_struct,
	X_key_struct => h_key_struct,
	X_cat_struct => h_cat_struct,
	X_loc_struct => h_loc_struct,
	X_precision =>  h_precision,
	X_user_id => X_user_id,
	X_login_id  =>  h_login_id,
        X_last_asset => (h_count = (X_num_assets - 1)),
	retcode => retcode,
	errbuf => errbuf);
Line: 415

	fa_whatif_deprn_pkg.g_deprn.delete;
Line: 473

	fa_whatif_deprn_pkg.g_deprn.delete;
Line: 482

        select r.basic_rate
        into   h_basic_rate
        from   fa_methods m, fa_flat_rates r
        where  m.method_code = X_method
        and    m.method_id = r.method_id
        and    r.adjusted_rate = X_adjusted_rate and rownum < 2;
Line: 492

      select currency_code
      into h_currency
      from gl_sets_of_books
      where set_of_books_id = FARX_C_WD.sob_id;
Line: 510

	-- insert the Currency_code - for Enhancement bug 3037321
      insert into fa_whatif_itf (
        request_id, asset_id, asset_number, description, tag_number,
        serial_number, period_name, fiscal_year, expense_acct,
        depreciation, new_depreciation, location, units, employee_name,
        employee_number, asset_key,
        current_cost, current_prorate_conv, current_method, current_life,
        current_basic_rate, current_adjusted_rate, current_salvage_value,
	bonus_depreciation, new_bonus_depreciation,
        created_by, creation_date, last_update_date,
        last_updated_by, last_update_login,category,date_placed_in_service,
        accumulated_deprn,currency_code
        ) values (
        X_request_id, NULL, NULL, NULL, NULL, NULL,
        fa_whatif_deprn_pkg.g_deprn(h_count).period_name,
        fa_whatif_deprn_pkg.g_deprn(h_count).fiscal_year, NULL,
        fa_whatif_deprn_pkg.g_deprn(h_count).deprn,
	fa_whatif_deprn_pkg.g_deprn(h_count).new_deprn,
        NULL, NULL, NULL, NULL,
        NULL, X_cost, X_prorate_conv, X_method,
        X_life, h_basic_rate, X_adjusted_rate, h_sal,
	fa_whatif_deprn_pkg.g_deprn(h_count).bonus_deprn,
	fa_whatif_deprn_pkg.g_deprn(h_count).new_bonus_deprn,
        X_user_id, sysdate, sysdate, X_user_id, h_login_id,
        h_concat_str, X_dpis,
	fa_whatif_deprn_pkg.g_deprn(h_count).new_rsv,h_currency);
Line: 542

  fa_whatif_deprn_pkg.g_deprn.delete;
Line: 553

	fa_whatif_deprn_pkg.g_deprn.delete;
Line: 596

  select bk.asset_id, bk.deprn_method_code, ad.asset_number
  from fa_books bk, fa_additions ad
  where ad.asset_category_id = nvl(X_category_id,ad.asset_category_id)
  and ad.description like nvl(X_description,ad.description)
  and ad.asset_number >= nvl(X_begin_asset,ad.asset_number)
  and ad.asset_number <= nvl(X_end_asset,ad.asset_number)
  and ad.asset_type in ('CAPITALIZED', 'GROUP')
  and bk.asset_id = ad.asset_id
  and bk.book_type_code = X_book
  and bk.production_capacity is null
  and bk.depreciate_flag = 'YES'
  and bk.transaction_header_id_out is null
  and bk.period_counter_fully_retired is null
  and bk.date_placed_in_service >=
	nvl(X_begin_dpis,bk.date_placed_in_service)
  and bk.date_placed_in_service <=
	nvl(X_end_dpis,bk.date_placed_in_service)
  and nvl(BK.Period_Counter_Fully_Reserved, -1)
	= decode(X_rsv_flag, 'YES',
		nvl(BK.Period_Counter_Fully_Reserved, -1),-1)
  and bk.group_asset_id is null;
Line: 620

    select 1
    from   fa_transaction_headers
    where  asset_id = c_asset_id
    and    book_type_code = c_book_type_code
    and    transaction_subtype = 'AMORTIZED';
Line: 685

       select count(*) into h_check
       from fa_deprn_detail
       where asset_id = h_asset_id
       and book_type_code = X_book
       and deprn_source_code = 'B'
       and not exists (select 1
                       from fa_deprn_detail dd1
                       where asset_id = h_asset_id
                       and book_type_code = X_book
                       and deprn_source_code = 'D'
                       and deprn_amount <> 0 );  -- bugfix 2223451 commented  deprn_amount > 0;