DBA Data[Home] [Help]

APPS.FA_MASSCHG_PKG SQL Statements

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

Line: 136

        select mch.status,
               mch.from_convention,
               mch.to_convention,
               mch.from_method_code,
               mch.to_method_code,
               mch.from_life_in_months,
               mch.to_life_in_months,
               mch.from_bonus_rule,
               mch.to_bonus_rule,
               mch.date_effective,
               mch.transaction_date_entered,
               mch.from_basic_rate,
               mch.to_basic_rate,
               mch.from_adjusted_rate,
               mch.to_adjusted_rate,
               mch.from_production_capacity,
               mch.to_production_capacity,
               mch.from_uom,
               mch.to_uom,
               mch.from_group_association,
               mch.to_group_association,
               mch.from_group_asset_id,
               mch.to_group_asset_id,
               mch.asset_type,
               mch.amortize_flag,
               mch.book_type_code,
               -- ,mch.allow_overlapping_adj_flag
               -- Bug 6964615
               mch.from_salvage_type,
               mch.to_salvage_type,
               mch.from_percent_salvage_value,
               mch.to_percent_salvage_value,
               mch.from_salvage_value,
               mch.to_salvage_value,
               mch.from_deprn_limit_type,
               mch.to_deprn_limit_type,
               mch.from_deprn_limit,
               mch.to_deprn_limit,
               mch.from_deprn_limit_amount,
               mch.to_deprn_limit_amount
          from fa_mass_changes    mch
         where mch.mass_change_id = p_mass_change_id;
Line: 181

        select ad.asset_number,
               bk.asset_id
          from fa_additions_b ad,
               fa_books bk,
               fa_mass_changes mch,
               fa_methods me
         where mch.mass_change_id           = p_mass_change_id
           and bk.transaction_header_id_out is null
           and bk.book_type_code            = mch.book_type_code
           and bk.date_placed_in_service    >=
                   nvl(mch.from_date_placed_in_service,
                       bk.date_placed_in_service)
           and bk.date_placed_in_service    <=
                   nvl(mch.to_date_placed_in_service,
                       bk.date_placed_in_service)
           and bk.period_counter_fully_retired is null
           and nvl(bk.period_counter_fully_reserved, -1) =
                   decode(mch.change_fully_rsvd_assets, 'YES',
                         nvl(bk.period_counter_fully_reserved, -1), -1)
           and bk.deprn_method_code            =
                   nvl(mch.from_method_code, bk.deprn_method_code)
           and nvl(bk.production_capacity, -1) =
                   nvl(mch.from_production_capacity,
                       nvl(bk.production_capacity, -1))
           and nvl(bk.unit_of_measure, -1)     =
                   nvl(mch.from_uom,nvl(bk.unit_of_measure, -1))
           and bk.prorate_convention_code      =
                   nvl(mch.from_convention, bk.prorate_convention_code)
           and ad.asset_number                >=
                   nvl(mch.from_asset_number, ad.asset_number)
           and ad.asset_number                <=
                   nvl(mch.to_asset_number, ad.asset_number)
           and ad.asset_type                  <>      'CIP'
           and ad.asset_type                   = nvl(mch.asset_type, ad.asset_type)
           and ad.asset_id                     =       bk.asset_id
           and ad.asset_category_id            =
                   nvl(mch.category_id,ad.asset_category_id)
           and me.method_code = mch.from_method_code
           and me.rate_source_rule = 'PRODUCTION'
           and ad.asset_id > px_max_asset_id
           and MOD(nvl(bk.group_asset_id, ad.asset_id), p_total_requests) = (p_request_number - 1)
          order by ad.asset_id;
Line: 227

        select ad.asset_number,
               bk.asset_id,
               bk.conversion_date,
               bk.date_effective,
               bk.date_placed_in_service,
               bk.group_asset_id
          from fa_additions_b                  ad,
               fa_books                        bk,
               fa_mass_changes                 mch
         where ad.asset_number         >=
                  nvl(mch.from_asset_number,
                      ad.asset_number)
           and ad.asset_number         <=
                  nvl(mch.to_asset_number,
                      ad.asset_number)
           and ad.asset_type           <>     'CIP'
           and ad.asset_type           =       nvl(mch.asset_type, ad.asset_type)
           and ad.asset_id             =       bk.asset_id
           and ad.asset_category_id    =
               nvl(mch.category_id,
                   ad.asset_category_id)
           and mch.mass_change_id      = p_mass_change_id
           and bk.book_type_code       =       mch.book_type_code
           and bk.transaction_header_id_out is null
           and bk.period_counter_fully_retired is null
           and nvl(bk.disabled_flag, 'N') = 'N' --HH ed.
           and nvl(bk.period_counter_fully_reserved,99)  =
                   nvl(bk.period_counter_life_complete,99)
           and nvl(bk.period_counter_fully_reserved, -1) =
                   decode(mch.change_fully_rsvd_assets, 'YES',
                          nvl(bk.period_counter_fully_reserved, -1), -1)
           and bk.date_placed_in_service                >=
                   nvl(mch.from_date_placed_in_service,
                       bk.date_placed_in_service)
           and bk.date_placed_in_service                <=
                   nvl(mch.to_date_placed_in_service,
                       bk.date_placed_in_service)
           and bk.deprn_method_code                      =
                   nvl(mch.from_method_code,
                       bk.deprn_method_code)
           and nvl(bk.life_in_months, -1)                =
                   nvl(mch.from_life_in_months,
                       nvl(bk.life_in_months, -1))
           and nvl(bk.basic_rate, -1)                    =
                   nvl(mch.from_basic_rate,
                       nvl(bk.basic_rate, -1))
           and nvl(bk.adjusted_rate, -1)                 =
                   nvl(mch.from_adjusted_rate,
                       nvl(bk.adjusted_rate, -1))
           and nvl(bk.production_capacity, -1)           =
                   nvl(mch.from_production_capacity,
                       nvl(bk.production_capacity, -1))
           and nvl(bk.unit_of_measure, -1)               =
                   nvl(mch.from_uom,
                       nvl(bk.unit_of_measure, -1))
           and bk.prorate_convention_code                =
                   nvl(mch.from_convention,
                       bk.prorate_convention_code)
           and nvl(bk.bonus_rule, -1)                    =
                   nvl(mch.from_bonus_rule,
                      nvl(bk.bonus_rule,-1))
           and ((mch.from_group_association is null) or
                (mch.from_group_association = 'STANDALONE' and
                 bk.group_asset_id is null) or
                (mch.from_group_association = 'MEMBER' and
                 nvl(bk.group_asset_id, -99) = mch.from_group_asset_id))
           -- Bug 6964615
           and nvl(bk.salvage_type, 'XX')                =
                   nvl(mch.from_salvage_type,
                       nvl(bk.salvage_type,'XX'))
           and nvl(bk.salvage_value, -99)                =
                   nvl(mch.from_salvage_value,
                       nvl(bk.salvage_value, -99))
           and nvl(bk.percent_salvage_value, -99)        =
                   nvl(mch.from_percent_salvage_value/100,
                       nvl(bk.percent_salvage_value, -99))
           and nvl(bk.deprn_limit_type, 'XX')            =
                   nvl(mch.from_deprn_limit_type,
                       nvl(bk.deprn_limit_type,'XX'))
           and nvl(bk.allowed_deprn_limit, -99)          =
                   nvl(mch.from_deprn_limit/100,
                       nvl(bk.allowed_deprn_limit, -99))
           and nvl(bk.allowed_deprn_limit_amount, -99)   =
                   nvl(mch.from_deprn_limit_amount,
                       nvl(bk.allowed_deprn_limit_amount, -99))
           and ad.asset_id > px_max_asset_id
           and MOD(nvl(bk.group_asset_id, ad.asset_id), p_total_requests) = (p_request_number - 1)
         order by ad.asset_id;
Line: 511

            update fa_books bk
               set bk.unit_of_measure   = l_to_uom,
                   bk.last_update_date  = sysdate,
                   bk.last_updated_by   = l_userid,
                   bk.last_update_login = l_login,
                   bk.annual_deprn_rounding_flag = 'ADJ'
            where  bk.asset_id          = l_asset_id(l_loop_count) and
                   bk.date_ineffective is null and
                   bk.book_type_code in
                      (select bc.book_type_code
                         from fa_book_controls bc,
                              fa_methods me
                        where bc.date_ineffective is null
                          and bc.distribution_source_book = l_book_type_code
                          and bc.book_class      <> 'BUDGET'
                          and me.method_code      = bk.deprn_method_code
                          and me.rate_source_rule = 'PRODUCTION'
                      );
Line: 619

                     select count(*)
                       into l_count
                       from fa_book_controls bc,
                            fa_books bk,
                            fa_methods me
                      where bk.book_type_code    = bc.book_type_code
                        and bk.asset_id          = l_asset_id(l_loop_count)
                        and bk.date_ineffective is null
                        and bc.distribution_source_book = l_book_type_code
                        and bc.date_ineffective is null
                        and bc.book_class        = 'TAX'
                        and me.method_code       = bk.deprn_method_code
                        and nvl(me.life_in_months, -1) = nvl(bk.life_in_months, -1)
                        and me.rate_source_rule  = 'PRODUCTION';
Line: 648

                     select count(*)
                       into l_count
                       from fa_book_controls bc,
                            fa_books bk,
                            fa_methods me
                      where bk.book_type_code    = bc.distribution_source_book
                        and bk.asset_id          = l_asset_id(l_loop_count)
                        and bk.date_ineffective is null
                        and bc.book_type_code    = l_book_type_code
                        and bc.date_ineffective is null
                        and me.method_code       = bk.deprn_method_code
                        and nvl(me.life_in_months, -1) = nvl(bk.life_in_months, -1)
                        and me.rate_source_rule = 'PRODUCTION';
Line: 686

            l_asset_fin_mrc_tbl_new.delete;
Line: 688

            l_inv_tbl.delete;
Line: 691

            l_asset_deprn_mrc_tbl_new.delete;
Line: 695

            l_trans_rec.who_info.last_update_date   := sysdate;
Line: 696

            l_trans_rec.who_info.last_updated_by    := FND_GLOBAL.USER_ID;
Line: 699

            l_trans_rec.who_info.last_update_login  := FND_GLOBAL.CONC_LOGIN_ID;
Line: 776

               select count(*)
                 into l_count
                 from fa_transaction_headers th
                where th.asset_id       = l_asset_id(l_loop_count)
                  and th.book_type_code = l_book_type_code
                  and th.transaction_date_entered > l_trx_date_entered;
Line: 807

               select salvage_type,
                      nvl(percent_salvage_value, 0),
                      nvl(salvage_value, 0),
                      deprn_limit_type,
                      nvl(allowed_deprn_limit, 0),
                      nvl(allowed_deprn_limit_amount, 0)
               into   l_old_salvage_type,
                      l_old_percent_salvage_value,
                      l_old_salvage_value,
                      l_old_deprn_limit_type,
                      l_old_deprn_limit,
                      l_old_deprn_limit_amount
               from   fa_books
               where  book_type_code = l_book_type_code
               and    asset_id = l_asset_id(l_loop_count)
               and    transaction_header_id_out is null;
Line: 902

               update fa_books bk
                  set bk.unit_of_measure    = l_to_uom,
                      bk.last_update_date   = sysdate,
                      bk.last_updated_by    = l_userid,
                      bk.last_update_login  = l_login,
                      bk.annual_deprn_rounding_flag = 'ADJ'
                where bk.asset_id           = l_asset_id(l_loop_count)
                  and bk.date_ineffective  is null
                  and bk.book_type_code in
                      (select bc.book_type_code
                         from fa_book_controls bc,
                              fa_methods me
                        where bc.distribution_source_book = l_book_type_code
                          and bc.book_class               = 'TAX'
                          and bc.date_ineffective        is null
                          and me.method_code              = bk.deprn_method_code
                          and me.rate_source_rule         = 'PRODUCTION'
                      );