DBA Data[Home] [Help]

APPS.FA_POLISH_PVT SQL Statements

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

Line: 314

         select fy.fiscal_year
         into   l_first_fiscal_year
         from   fa_fiscal_year fy,
                fa_book_controls_mrc_v bc,
                fa_books_mrc_v bks
         where  bc.book_type_code = p_Book_Type_Code
         and    bc.fiscal_year_name = fy.fiscal_year_name
         and    bks.book_type_code = p_Book_Type_Code
         and    bks.asset_id = p_Asset_Id
         and    bks.transaction_header_id_out is null
         and    bks.date_placed_in_service between
                fy.start_date and fy.end_date;
Line: 327

         select dp.period_counter
         into   l_first_period_counter
         from   fa_deprn_periods_mrc_v dp,
                fa_books_mrc_v bks
         where  dp.book_type_code = p_Book_Type_Code
         and    bks.book_type_code = p_Book_Type_Code
         and    bks.asset_id = p_Asset_Id
         and    bks.transaction_header_id_out is null
         and    bks.date_placed_in_service between
                dp.calendar_period_open_date and dp.calendar_period_close_date;
Line: 338

         select period_counter
         into   l_open_period_counter
         from   fa_deprn_periods_mrc_v
         where  book_type_code = p_Book_Type_Code
         and    period_close_date is null;
Line: 346

         select fy.fiscal_year
         into   l_first_fiscal_year
         from   fa_fiscal_year fy,
                fa_book_controls bc,
                fa_books bks
         where  bc.book_type_code = p_Book_Type_Code
         and    bc.fiscal_year_name = fy.fiscal_year_name
         and    bks.book_type_code = p_Book_Type_Code
         and    bks.asset_id = p_Asset_Id
         and    bks.transaction_header_id_out is null
         and    bks.date_placed_in_service between
                fy.start_date and fy.end_date;
Line: 359

         select dp.period_counter
         into   l_first_period_counter
         from   fa_deprn_periods dp,
                fa_books bks
         where  dp.book_type_code = p_Book_Type_Code
         and    bks.book_type_code = p_Book_Type_Code
         and    bks.asset_id = p_Asset_Id
         and    bks.transaction_header_id_out is null
         and    bks.date_placed_in_service between
                dp.calendar_period_open_date and dp.calendar_period_close_date;
Line: 370

         select period_counter
         into   l_open_period_counter
         from   fa_deprn_periods
         where  book_type_code = p_Book_Type_Code
         and    period_close_date is null;
Line: 393

         select adjusted_cost
         into   l_old_adjusted_cost
         from   fa_books_mrc_v
         where  book_type_code = p_Book_Type_Code
         and    asset_id = p_Asset_Id
         and    transaction_header_id_out is null;
Line: 402

         select adjusted_cost
         into   l_old_adjusted_cost
         from   fa_books
         where  book_type_code = p_Book_Type_Code
         and    asset_id = p_Asset_Id
         and    transaction_header_id_out is null;
Line: 466

         select transaction_type_code,
                transaction_header_id
         into   l_transaction_type_code,
                l_transaction_header_id
         from   fa_transaction_headers
         where  book_type_code = p_Book_Type_Code
         and    asset_id = p_Asset_ID
         and    transaction_type_code in ('ADJUSTMENT', 'PARTIAL RETIREMENT')
         and    transaction_header_id =
         (
          select max(transaction_header_id)
          from   fa_transaction_headers
          where  book_type_code = p_Book_Type_Code
          and    asset_id = p_Asset_ID
          and    transaction_type_code in ('ADJUSTMENT', 'PARTIAL RETIREMENT')
         );
Line: 537

         select  deprn_reserve
         into    l_first_year_reserve
         from    fa_deprn_summary_mrc_v
         where   book_type_code  = p_Book_Type_Code
         and     asset_id = p_Asset_Id
         and     period_counter = l_first_year_period_counter;
Line: 544

         select  deprn_reserve
         into    l_prev_year_reserve
         from    fa_deprn_summary_mrc_v
         where   book_type_code  = p_Book_Type_Code
         and     asset_id = p_Asset_Id
         and     period_counter = l_prev_year_period_counter;
Line: 555

            select  polish_deprn_basis,
                    polish_adj_rec_cost
            into    l_prev_year_adjusted_cost,
                    l_prev_year_adj_rec_cost
            from    fa_books_summary_mrc_v
            where   book_type_code  = p_Book_Type_Code
            and     asset_id = p_Asset_Id
            and     period_counter = l_prev_year_period_counter;
Line: 580

               select min(period_counter)
               into   l_min_period_counter
               from   fa_deprn_periods_mrc_v
               where  book_type_code = p_Book_Type_Code;
Line: 589

                     select bks.adjusted_cost,
                            bks.adjusted_recoverable_cost
                     into   l_prev_year_adjusted_cost,
                            l_prev_year_adj_rec_cost
                     from   fa_books_mrc_v bks
                     where  bks.book_type_code = p_Book_Type_Code
                     and    bks.asset_id = p_Asset_Id
                     and    bks.rowid =
                     (
                      select max(bks1.rowid)
                      from   fa_books_mrc_v bks1,
                             fa_deprn_periods_mrc_v dp
                      where  bks1.book_type_code = p_Book_Type_Code
                      and    bks1.asset_id = p_Asset_Id
                      and    bks1.book_type_code = dp.book_type_code
                      and    dp.period_counter = l_prev_year_period_counter
                      and    bks1.date_effective <=
                             nvl(dp.period_close_date, sysdate)
                     );
Line: 616

                     select bks.adjusted_cost,
                            bks.adjusted_recoverable_cost
                     into   l_prev_year_adjusted_cost,
                            l_prev_year_adj_rec_cost
                     from   fa_books_mrc_v bks
                     where  bks.book_type_code = p_Book_Type_Code
                     and    bks.asset_id = p_Asset_Id
                     and    bks.rowid =
                     (
                      select min(bks1.rowid)
                      from   fa_books_mrc_v bks1
                      where  bks1.book_type_code = p_Book_Type_Code
                      and    bks1.asset_id = p_Asset_Id
                     );
Line: 639

         select  deprn_reserve
         into    l_first_year_reserve
         from    fa_deprn_summary
         where   book_type_code  = p_Book_Type_Code
         and     asset_id = p_Asset_Id
         and     period_counter = l_first_year_period_counter;
Line: 646

         select  deprn_reserve
         into    l_prev_year_reserve
         from    fa_deprn_summary
         where   book_type_code  = p_Book_Type_Code
         and     asset_id = p_Asset_Id
         and     period_counter = l_prev_year_period_counter;
Line: 657

            select  polish_deprn_basis,
                    polish_adj_rec_cost
            into    l_prev_year_adjusted_cost,
                    l_prev_year_adj_rec_cost
            from    fa_books_summary
            where   book_type_code  = p_Book_Type_Code
            and     asset_id = p_Asset_Id
            and     period_counter = l_prev_year_period_counter;
Line: 683

               select min(period_counter)
               into   l_min_period_counter
               from   fa_deprn_periods
               where  book_type_code = p_Book_Type_Code;
Line: 692

                     select bks.adjusted_cost,
                            bks.adjusted_recoverable_cost
                     into   l_prev_year_adjusted_cost,
                            l_prev_year_adj_rec_cost
                     from   fa_books bks
                     where  bks.book_type_code = p_Book_Type_Code
                     and    bks.asset_id = p_Asset_Id
                     and    bks.rowid =
                     (
                      select max(bks1.rowid)
                      from   fa_books bks1,
                             fa_deprn_periods dp
                      where  bks1.book_type_code = p_Book_Type_Code
                      and    bks1.asset_id = p_Asset_Id
                      and    bks1.book_type_code = dp.book_type_code
                      and    dp.period_counter = l_prev_year_period_counter
                      and    bks1.date_effective <=
                             nvl(dp.period_close_date, sysdate)
                     );
Line: 719

                     select bks.adjusted_cost,
                            bks.adjusted_recoverable_cost
                     into   l_prev_year_adjusted_cost,
                            l_prev_year_adj_rec_cost
                     from   fa_books bks
                     where  bks.book_type_code = p_Book_Type_Code
                     and    bks.asset_id = p_Asset_Id
                     and    bks.rowid =
                     (
                      select min(bks1.rowid)
                      from   fa_books bks1
                      where  bks1.book_type_code = p_Book_Type_Code
                      and    bks1.asset_id = p_Asset_Id
                     );
Line: 762

               select adjusted_cost
               into   l_prev_year_adjusted_cost
               from   fa_books_mrc_v
               where  asset_id = p_asset_id
               and    book_type_code = p_book_type_code
               and    transaction_header_id_out is null;
Line: 770

               select adjusted_cost
               into   l_prev_year_adjusted_cost
               from   fa_books
               where  asset_id = p_asset_id
               and    book_type_code = p_book_type_code
               and    transaction_header_id_out is null;
Line: 1220

            select period_counter - 1
            into   x_bef_trxn_period_counter
            from   fa_deprn_periods_mrc_v
            where  book_type_code = p_Book_Type_Code
            and    l_amortization_start_date between
                   calendar_period_open_date and calendar_period_close_date;
Line: 1227

            select period_counter - 1
            into   x_bef_trxn_period_counter
            from   fa_deprn_periods
            where  book_type_code = p_Book_Type_Code
            and    l_amortization_start_date between
                   calendar_period_open_date and calendar_period_close_date;
Line: 1258

            select adjustment_amount,
                   debit_credit_flag
             into  x_adjustment_amount,
                   l_debit_credit_flag
             from  fa_adjustments_mrc_v
             where book_type_code  = p_Book_Type_Code
             and   asset_id = p_Asset_Id
             and   transaction_header_id = p_transaction_header_id
             and   source_type_code = 'ADJUSTMENT'
             and   adjustment_type = 'COST';
Line: 1270

            select adjustment_amount,
                   debit_credit_flag
             into  x_adjustment_amount,
                   l_debit_credit_flag
             from  fa_adjustments
             where book_type_code  = p_Book_Type_Code
             and   asset_id = p_Asset_Id
             and   transaction_header_id = p_transaction_header_id
             and   source_type_code = 'ADJUSTMENT'
             and   adjustment_type = 'COST';
Line: 1316

               select dp.period_counter - 1
               into   x_bef_trxn_period_counter
               from   fa_deprn_periods_mrc_v dp,
                      fa_transaction_headers th
               where  th.transaction_header_id = p_transaction_header_id
               and    dp.book_type_code = p_Book_Type_Code
               and    th.date_effective between
                      dp.period_open_date and
                      nvl(dp.period_close_date, sysdate);
Line: 1327

               select dp.period_counter - 1
               into   x_bef_trxn_period_counter
               from   fa_deprn_periods dp,
                      fa_transaction_headers th
               where  th.transaction_header_id = p_transaction_header_id
               and    dp.book_type_code = p_Book_Type_Code
               and    th.date_effective between
                      dp.period_open_date and
                      nvl(dp.period_close_date, sysdate);
Line: 1347

               select dp.period_counter - 1
               into   x_bef_trxn_period_counter
               from   fa_deprn_periods_mrc_v dp,
                      fa_transaction_headers th
               where  th.transaction_header_id = p_transaction_header_id
               and    dp.book_type_code = p_Book_Type_Code
               and    th.transaction_date_entered between
                      dp.calendar_period_open_date and
                      dp.calendar_period_close_date;
Line: 1358

               select dp.period_counter - 1
               into   x_bef_trxn_period_counter
               from   fa_deprn_periods dp,
                      fa_transaction_headers th
               where  th.transaction_header_id = p_transaction_header_id
               and    dp.book_type_code = p_Book_Type_Code
               and    th.transaction_date_entered between
                      dp.calendar_period_open_date and
                      dp.calendar_period_close_date;
Line: 1383

            select polish_deprn_basis,
                   polish_adj_rec_cost
            into   x_prev_basis,
                   x_prev_adj_rec_cost
            from   fa_books_summary_mrc_v
            where  book_type_code = p_Book_Type_Code
            and    asset_id = p_Asset_Id
            and    period_counter = x_bef_trxn_period_counter;
Line: 1409

               select min(period_counter)
               into   l_min_period_counter
               from   fa_deprn_periods_mrc_v
               where  book_type_code = p_Book_Type_Code;
Line: 1418

                     select bks.adjusted_cost,
                            bks.adjusted_recoverable_cost
                     into   x_prev_basis,
                            x_prev_adj_rec_cost
                     from   fa_books_mrc_v bks
                     where  bks.book_type_code = p_Book_Type_Code
                     and    bks.asset_id = p_Asset_Id
                     and    bks.rowid =
                     (
                      select max(bks1.rowid)
                      from   fa_books_mrc_v bks1,
                             fa_deprn_periods_mrc_v dp
                      where  bks1.book_type_code = p_Book_Type_Code
                      and    bks1.asset_id = p_Asset_Id
                      and    bks1.book_type_code = dp.book_type_code
                      and    dp.period_counter = x_bef_trxn_period_counter
                      and    bks1.date_effective <=
                             nvl(dp.period_close_date, sysdate)
                     );
Line: 1441

                     select bks.adjusted_cost,
                            bks.adjusted_recoverable_cost
                     into   x_prev_basis,
                            x_prev_adj_rec_cost
                     from   fa_books_mrc_v bks
                     where  bks.book_type_code = p_Book_Type_Code
                     and    bks.asset_id = p_Asset_Id
                     and    bks.rowid =
                     (
                      select min(bks1.rowid)
                      from   fa_books_mrc_v bks1
                      where  bks1.book_type_code = p_Book_Type_Code
                      and    bks1.asset_id = p_Asset_Id
                     );
Line: 1459

         select deprn_reserve
         into   x_prev_reserve
         from   fa_deprn_summary_mrc_v
         where  book_type_code = p_Book_Type_Code
         and    asset_id = p_Asset_Id
         and    period_counter = x_bef_trxn_period_counter;
Line: 1471

            select polish_deprn_basis,
                   polish_adj_rec_cost
            into   x_prev_basis,
                   x_prev_adj_rec_cost
            from   fa_books_summary
            where  book_type_code = p_Book_Type_Code
            and    asset_id = p_Asset_Id
            and    period_counter = x_bef_trxn_period_counter;
Line: 1497

               select min(period_counter)
               into   l_min_period_counter
               from   fa_deprn_periods
               where  book_type_code = p_Book_Type_Code;
Line: 1506

                     select bks.adjusted_cost,
                            bks.adjusted_recoverable_cost
                     into   x_prev_basis,
                            x_prev_adj_rec_cost
                     from   fa_books bks
                     where  bks.book_type_code = p_Book_Type_Code
                     and    bks.asset_id = p_Asset_Id
                     and    bks.rowid =
                     (
                      select max(bks1.rowid)
                      from   fa_books bks1,
                             fa_deprn_periods dp
                      where  bks1.book_type_code = p_Book_Type_Code
                      and    bks1.asset_id = p_Asset_Id
                      and    bks1.book_type_code = dp.book_type_code
                      and    dp.period_counter = x_bef_trxn_period_counter
                      and    bks1.date_effective <=
                             nvl(dp.period_close_date, sysdate)
                     );
Line: 1529

                     select bks.adjusted_cost,
                            bks.adjusted_recoverable_cost
                     into   x_prev_basis,
                            x_prev_adj_rec_cost
                     from   fa_books bks
                     where  bks.book_type_code = p_Book_Type_Code
                     and    bks.asset_id = p_Asset_Id
                     and    bks.rowid =
                     (
                      select min(bks1.rowid)
                      from   fa_books bks1
                      where  bks1.book_type_code = p_Book_Type_Code
                      and    bks1.asset_id = p_Asset_Id
                     );
Line: 1547

         select deprn_reserve
         into   x_prev_reserve
         from   fa_deprn_summary
         where  book_type_code = p_Book_Type_Code
         and    asset_id = p_Asset_Id
         and    period_counter = x_bef_trxn_period_counter;
Line: 1570

         select adjustment_amount,
                debit_credit_flag
         into   x_retirement_amount,
                l_debit_credit_flag
         from   fa_adjustments_mrc_v
         where  book_type_code = p_Book_Type_Code
         and    asset_id = p_Asset_Id
         and    transaction_header_id = p_transaction_header_id
         and    source_type_code = 'RETIREMENT'
         and    adjustment_type = 'COST';
Line: 1581

         select dp.period_counter - 1
         into   x_bef_trxn_period_counter
         from   fa_deprn_periods_mrc_v dp,
                fa_transaction_headers th
         where  th.transaction_header_id = p_transaction_header_id
         and    dp.book_type_code = p_Book_Type_Code
         and    th.transaction_date_entered between
                dp.calendar_period_open_date and
                dp.calendar_period_close_date;
Line: 1592

         select adjustment_amount,
                debit_credit_flag
         into   x_retirement_amount,
                l_debit_credit_flag
         from   fa_adjustments
         where  book_type_code = p_Book_Type_Code
         and    asset_id = p_Asset_Id
         and    transaction_header_id = p_transaction_header_id
         and    source_type_code = 'RETIREMENT'
         and    adjustment_type = 'COST';
Line: 1603

         select dp.period_counter - 1
         into   x_bef_trxn_period_counter
         from   fa_deprn_periods dp,
                fa_transaction_headers th
         where  th.transaction_header_id = p_transaction_header_id
         and    dp.book_type_code = p_Book_Type_Code
         and    th.transaction_date_entered between
                dp.calendar_period_open_date and
                dp.calendar_period_close_date;
Line: 1631

            select polish_deprn_basis,
                   polish_adj_rec_cost
            into   x_prev_basis,
                   x_prev_adj_rec_cost
            from   fa_books_summary_mrc_v
            where  book_type_code = p_Book_Type_Code
            and    asset_id = p_Asset_Id
            and    period_counter = x_bef_trxn_period_counter;
Line: 1657

               select min(period_counter)
               into   l_min_period_counter
               from   fa_deprn_periods_mrc_v
               where  book_type_code = p_Book_Type_Code;
Line: 1666

                     select bks.adjusted_cost,
                            bks.adjusted_recoverable_cost
                     into   x_prev_basis,
                            x_prev_adj_rec_cost
                     from   fa_books_mrc_v bks
                     where  bks.book_type_code = p_Book_Type_Code
                     and    bks.asset_id = p_Asset_Id
                     and    bks.rowid =
                     (
                      select max(bks1.rowid)
                      from   fa_books_mrc_v bks1,
                             fa_deprn_periods_mrc_v dp
                      where  bks1.book_type_code = p_Book_Type_Code
                      and    bks1.asset_id = p_Asset_Id
                      and    bks1.book_type_code = dp.book_type_code
                      and    dp.period_counter = x_bef_trxn_period_counter
                      and    bks1.date_effective <=
                             nvl(dp.period_close_date, sysdate)
                     );
Line: 1689

                     select bks.adjusted_cost,
                            bks.adjusted_recoverable_cost
                     into   x_prev_basis,
                            x_prev_adj_rec_cost
                     from   fa_books_mrc_v bks
                     where  bks.book_type_code = p_Book_Type_Code
                     and    bks.asset_id = p_Asset_Id
                     and    bks.rowid =
                     (
                      select min(bks1.rowid)
                      from   fa_books_mrc_v bks1
                      where  bks1.book_type_code = p_Book_Type_Code
                      and    bks1.asset_id = p_Asset_Id
                     );
Line: 1713

            select polish_deprn_basis,
                   polish_adj_rec_cost
            into   x_prev_basis,
                   x_prev_adj_rec_cost
            from   fa_books_summary
            where  book_type_code = p_Book_Type_Code
            and    asset_id = p_Asset_Id
            and    period_counter = x_bef_trxn_period_counter;
Line: 1739

               select min(period_counter)
               into   l_min_period_counter
               from   fa_deprn_periods
               where  book_type_code = p_Book_Type_Code;
Line: 1748

                     select bks.adjusted_cost,
                            bks.adjusted_recoverable_cost
                     into   x_prev_basis,
                            x_prev_adj_rec_cost
                     from   fa_books bks
                     where  bks.book_type_code = p_Book_Type_Code
                     and    bks.asset_id = p_Asset_Id
                     and    bks.rowid =
                     (
                      select max(bks1.rowid)
                      from   fa_books bks1,
                             fa_deprn_periods dp
                      where  bks1.book_type_code = p_Book_Type_Code
                      and    bks1.asset_id = p_Asset_Id
                      and    bks1.book_type_code = dp.book_type_code
                      and    dp.period_counter = x_bef_trxn_period_counter
                      and    bks1.date_effective <=
                             nvl(dp.period_close_date, sysdate)
                     );
Line: 1771

                     select bks.adjusted_cost,
                            bks.adjusted_recoverable_cost
                     into   x_prev_basis,
                            x_prev_adj_rec_cost
                     from   fa_books bks
                     where  bks.book_type_code = p_Book_Type_Code
                     and    bks.asset_id = p_Asset_Id
                     and    bks.rowid =
                     (
                      select min(bks1.rowid)
                      from   fa_books bks1
                      where  bks1.book_type_code = p_Book_Type_Code
                      and    bks1.asset_id = p_Asset_Id
                     );
Line: 1948

            select nvl(switch_code, 'XX')
            into   x_switch_code
            from   fa_books_summary_mrc_v
            where  book_type_code = p_book_type_code
            and    asset_id = p_asset_id
            and    period_counter = p_period_counter;
Line: 1961

            select nvl(switch_code, 'XX')
            into   x_switch_code
            from   fa_books_summary
            where  book_type_code = p_book_type_code
            and    asset_id = p_asset_id
            and    period_counter = p_period_counter;
Line: 1979

            select nvl(switch_code, 'XX')
            into   l_prev_switch_code
            from   fa_books_summary_mrc_v
            where  book_type_code = p_book_type_code
            and    asset_id = p_asset_id
            and    period_counter = p_period_counter - 1;
Line: 1992

            select nvl(switch_code, 'XX')
            into   l_prev_switch_code
            from   fa_books_summary
            where  book_type_code = p_book_type_code
            and    asset_id = p_asset_id
            and    period_counter = p_period_counter - 1;