DBA Data[Home] [Help]

APPS.IGI_IAC_COMMON_UTILS SQL Statements

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

Line: 27

        SELECT  dp.period_num, dp.period_name, dp.calendar_period_open_date ,
                dp.calendar_period_close_date , p_period_counter, dp.fiscal_year
        INTO    p_prd_rec.period_num, p_prd_rec.period_name, p_prd_rec.period_start_date,
                p_prd_rec.period_end_date, p_prd_rec.period_counter , p_prd_rec.fiscal_year
        FROM    fa_deprn_periods dp
        WHERE   dp.book_type_code = P_book_type_code
        AND     dp.period_counter = P_period_counter ;
Line: 37

            SELECT  cp.period_num, cp.period_name, cp.start_date ,
                    cp.end_Date  , p_period_counter, fy.fiscal_year
            INTO    p_prd_rec.period_num, p_prd_rec.period_name, p_prd_rec.period_start_date,
                    p_prd_rec.period_end_date, p_prd_rec.period_counter , p_prd_rec.fiscal_year
	    FROM   fa_fiscal_year fy ,
		   fa_calendar_types ct ,
		   fa_calendar_periods cp,
		   fa_book_controls    bc
	    WHERE  ct.fiscal_year_name = fy.fiscal_year_name
	    AND    bc.book_type_code = P_book_type_code
	    AND    ct.calendar_type = bc.deprn_Calendar
	    AND    fy.fiscal_year   = decode( mod ( P_period_counter , ct.number_per_fiscal_year ) , 0 ,
                                      trunc ( P_period_counter / ct.number_per_fiscal_year ) -1 ,
                                      trunc ( P_period_counter / ct.number_per_fiscal_year ) )
	    AND    cp.calendar_type = ct.calendar_type
	    AND    cp.start_Date >= fy.start_date
	    AND    cp.end_Date <= fy.end_Date
	    AND    cp.period_num = decode( mod ( P_period_counter , ct.number_per_fiscal_year ),0 ,ct.number_per_fiscal_year,
	                                   mod ( P_period_counter , ct.number_per_fiscal_year ));
Line: 78

        SELECT  dp.period_num, dp.period_name, dp.calendar_period_open_date ,
                dp.calendar_period_close_date , dp.period_counter, dp.fiscal_year
        INTO    p_prd_rec.period_num, p_prd_rec.period_name, p_prd_rec.period_start_date,
                p_prd_rec.period_end_date, p_prd_rec.period_counter , p_prd_rec.fiscal_year
        FROM    fa_deprn_periods dp
        WHERE   dp.book_type_code = P_book_type_code
        AND     P_date between dp.calendar_period_open_Date and dp.calendar_period_close_date;
Line: 87

            SELECT  cp.period_num, cp.period_name, cp.start_date ,
                    cp.end_Date  ,
                    ((fy.fiscal_year*ct.number_per_fiscal_year)+cp.period_num) p_period_counter,
                    fy.fiscal_year
            INTO    p_prd_rec.period_num, p_prd_rec.period_name, p_prd_rec.period_start_date,
                    p_prd_rec.period_end_date, p_prd_rec.period_counter , p_prd_rec.fiscal_year
	    FROM   fa_fiscal_year fy ,
		   fa_calendar_types ct ,
		   fa_calendar_periods cp ,
		   fa_book_controls    bc
	    WHERE  ct.fiscal_year_name = fy.fiscal_year_name
	    AND    bc.book_type_code = P_book_type_code
	    AND    ct.calendar_type = bc.deprn_Calendar
	    AND    P_date between cp.start_date and cp.end_Date
	    AND    P_date between fy.start_date and fy.end_Date
	    AND    cp.calendar_type = ct.calendar_type
	    AND    cp.start_Date >= fy.start_date
	    AND    cp.end_Date <= fy.end_Date;
Line: 126

        SELECT  dp.period_num, dp.period_name, dp.calendar_period_open_date ,
                dp.calendar_period_close_date , dp.period_counter, dp.fiscal_year
        INTO    p_prd_rec.period_num, p_prd_rec.period_name, p_prd_rec.period_start_date,
                p_prd_rec.period_end_date, p_prd_rec.period_counter , p_prd_rec.fiscal_year
        FROM    fa_deprn_periods dp
        WHERE   dp.book_type_code = P_book_type_code
        AND     dp.period_name    = P_prd_name ;
Line: 135

            SELECT  cp.period_num, cp.period_name, cp.start_date ,
                    cp.end_Date  ,
                    ((fy.fiscal_year*ct.number_per_fiscal_year)+cp.period_num) p_period_counter,
                    fy.fiscal_year
            INTO    p_prd_rec.period_num, p_prd_rec.period_name, p_prd_rec.period_start_date,
                    p_prd_rec.period_end_date, p_prd_rec.period_counter , p_prd_rec.fiscal_year
	    FROM   fa_fiscal_year fy ,
		   fa_calendar_types ct ,
		   fa_calendar_periods cp ,
		   fa_book_controls    bc
	    WHERE  ct.fiscal_year_name = fy.fiscal_year_name
	    AND    bc.book_type_code = P_book_type_code
	    AND    ct.calendar_type = bc.deprn_Calendar
	    AND    cp.calendar_type = ct.calendar_type
	    AND    cp.period_name = P_prd_name
	    AND    cp.start_Date >= fy.start_date
	    AND    cp.end_Date <= fy.end_Date;
Line: 171

    SELECT dp.Period_Name, dp.Period_Counter, dp.Period_Num,
           dp.Fiscal_Year, dp.calendar_Period_open_Date, dp.calendar_Period_close_Date
    INTO   p_prd_rec.Period_Name, p_prd_rec.Period_Counter, p_prd_rec.Period_Num,
           p_prd_rec.Fiscal_Year, p_prd_rec.Period_Start_Date, p_prd_rec.Period_End_Date
    FROM    fa_deprn_periods dp
    WHERE   dp.book_type_code = P_book_type_code
    AND     dp.period_close_date IS NULL ;
Line: 200

        SELECT *
        FROM   fa_retirements
        WHERE  retirement_id = P_Retirement_Id ;
Line: 255

    SELECT h.units
    INTO   p_units_before
    FROM   fa_asset_history h
    WHERE  h.asset_id = P_asset_id
    AND    h.transaction_header_id_out =  l_txn_id_before ;
Line: 261

    SELECT h.units
    INTO   p_units_after
    FROM   fa_asset_history h
    WHERE  h.asset_id = P_asset_id
    AND    h.transaction_header_id_in =  l_txn_id_before ;
Line: 291

    SELECT b.cost, r.cost_retired
    INTO   l_cost, l_cost_retired
    FROM   fa_books b,  fa_retirements r
    WHERE  b.book_type_code            = P_book_type_Code
    AND    b.asset_id                  = P_asset_id
    AND    r.retirement_id             = P_retirement_id
    AND    r.retirement_id             = b.retirement_id ;
Line: 324

    SELECT  t.transaction_type_code
    INTO    l_transaction_type
    FROM    fa_transaction_headers t, fa_retirements r
    WHERE   t.transaction_header_id = r.transaction_header_id_in
    AND     r.retirement_id  = P_retirement_id ;
Line: 330

    SELECT  r.units
    INTO    l_units
    FROM    fa_retirements r
--ssmales    WHERE   r.transaction_header_id_in = P_transaction_header_id
    WHERE   r.retirement_id = P_retirement_id
    AND     r.book_type_code = P_book_type_code
    AND     r.asset_id       = P_asset_id ;
Line: 370

         SELECT *
         FROM   fa_distribution_history
         WHERE  asset_id  = P_Asset_Id
         AND    book_type_code = P_book_type_code
    	 AND    date_ineffective IS NULL ;
Line: 383

    SELECT h.units
    INTO   l_tot_units
    FROM   fa_asset_history h
    WHERE  asset_id  = P_asset_id
    AND    date_ineffective IS NULL ;
Line: 428

        SELECT dh.*
        FROM   fa_distribution_history dh
        WHERE  dh.asset_id = P_Asset_Id
        AND    dh.book_type_code = P_book_type_Code
        AND    dh.date_ineffective IS NULL ;
Line: 475

    SELECT b.date_placed_in_service
    INTO   l_dpis
    FROM   fa_books b
    WHERE  b.book_type_code = P_book_type_code
    AND    b.asset_id       = P_Asset_Id
    AND    b.date_ineffective IS NULL ;
Line: 522

    SELECT dp.period_counter
    INTO   l_curr_prd_Counter
    FROM   fa_deprn_periods dp
    WHERE  dp.book_type_Code   = P_book_type_code
    AND    dp.period_close_date IS NULL;
Line: 530

    SELECT count(*)
    INTO   l_tot_records
    FROM   igi_iac_transaction_headers it
    WHERE  it.book_type_Code        = P_book_type_code
    AND    it.asset_id              = P_asset_id
    AND    it.transaction_type_Code = 'REVALUATION'
    AND    it.period_counter        = l_prev_prd_counter
    AND    it.adjustment_status     = 'R' ;
Line: 563

    SELECT count(*)
    INTO   l_tot_records
    FROM   fa_transaction_headers ft ,
           fa_deprn_periods dp
    WHERE  ft.book_type_Code        = P_book_type_code
    AND    ft.asset_id              = P_asset_id
    AND    dp.book_type_Code        = P_book_type_code
    AND    dp.period_close_Date     IS NULL
    AND    ft.date_effective        >= dp.period_open_date ;
Line: 600

    SELECT count(*)
    INTO   l_tot_records
    FROM   fa_transaction_headers ft
    WHERE  ft.book_type_Code        = P_book_type_code
    AND    ft.asset_id              = P_asset_id
    AND    ft.transaction_type_Code = 'ADJUSTMENT';
Line: 633

    SELECT count(*)
    INTO   l_tot_records
    FROM   fa_transaction_headers ft
    WHERE  ft.book_type_Code        = P_book_type_code
    AND    ft.asset_id              = P_asset_id
    AND    ft.transaction_type_Code = 'REVALUATION';
Line: 677

    SELECT ct.calendar_type , ct.fiscal_year_name
    INTO   l_calendar , l_fiscal_year_name
    FROM   fa_Calendar_types ct , fa_book_controls bc
    WHERE  ct.calendar_type  = bc.deprn_calendar
    AND    bc.book_type_Code = P_book_type_Code ;
Line: 683

    SELECT fy.start_Date
    INTO   l_fy_start_date
    FROM   fa_fiscal_year fy
    WHERE  fy.fiscal_year_name = l_fiscal_year_name
    AND    fy.fiscal_year      = l_prd_tab.fiscal_year ;
Line: 691

/*    SELECT count(*)
    INTO   l_tot_retirements
    FROM   fa_retirements r
    WHERE  r.book_type_code    = P_book_type_Code
    AND    r.asset_id          = P_asset_id
    AND    r.status           IN ('PROCESSED' , 'PENDING', 'PARTIAL' , 'REINSTATE' )
    AND    r.date_retired     >= l_fy_start_date ;
Line: 700

    SELECT count(*)
    INTO   l_tot_retirements
    FROM   fa_retirements r
    WHERE  r.book_type_code    = P_book_type_Code
    AND    r.transaction_header_id_out IS NULL
    AND    r.asset_id          = P_asset_id
    AND    r.status           IN ('PROCESSED' , 'PENDING', 'PARTIAL' , 'REINSTATE' )
    AND    r.date_retired     >= l_fy_start_date
    AND    EXISTS ( SELECT  'x'
                    FROM    fa_transaction_headers t
                    WHERE   t.transaction_header_id = r.transaction_header_id_in
                    AND     t.transaction_type_code = 'FULL RETIREMENT' );
Line: 739

      Cursor C1 is select asset_id
      	from igi_iac_asset_balances
      	where asset_id = X_asset_id
      	and book_type_code = X_book_type_code
      	and  rownum = 1 ;
Line: 771

        Cursor C1 is select date_placed_in_service
        from fa_books fb ,
             igi_iac_book_controls ibc
        Where fb.book_type_code = ibc.book_type_code
        AND   fb.book_type_code = X_book_type_code
        AND   fb.asset_id = X_asset_id
        AND   fb.date_ineffective is null;
Line: 790

        SELECT  dp.period_num, dp.period_name, dp.calendar_period_open_date ,
                dp.calendar_period_close_date , dp.period_counter, dp.fiscal_year
        INTO    l_prd_rec.period_num, l_prd_rec.period_name, l_prd_rec.period_start_date,
                l_prd_rec.period_end_date, l_prd_rec.period_counter , l_prd_rec.fiscal_year
        FROM    fa_deprn_periods dp
        WHERE   dp.book_type_code = X_book_type_code
        AND     l_dpis between dp.calendar_period_open_Date and dp.calendar_period_close_date;
Line: 799

            SELECT  cp.period_num, cp.period_name, cp.start_date ,
                    cp.end_Date  ,
                    ((fy.fiscal_year*ct.number_per_fiscal_year)+cp.period_num) p_period_counter,
                    fy.fiscal_year
            INTO    l_prd_rec.period_num, l_prd_rec.period_name, l_prd_rec.period_start_date,
                    l_prd_rec.period_end_date, l_prd_rec.period_counter , l_prd_rec.fiscal_year
	    FROM   fa_fiscal_year fy ,
		   fa_calendar_types ct ,
		   fa_calendar_periods cp ,
		   fa_book_controls    bc
	    WHERE  ct.fiscal_year_name = fy.fiscal_year_name
	    AND    bc.book_type_code = X_book_type_code
	    AND    ct.calendar_type = bc.deprn_Calendar
	    AND    l_dpis between cp.start_date and cp.end_Date
	    AND    l_dpis between fy.start_date and fy.end_Date
	    AND    cp.calendar_type = ct.calendar_type
	    AND    cp.start_Date >= fy.start_date
	    AND    cp.end_Date <= fy.end_Date;
Line: 841

        select asset_category_id
        from fa_additions
        where asset_id = X_asset_id;
Line: 846

        select price_index_id
        from igi_iac_category_books
        where book_type_code = X_book_type_code
        and   category_id = p_cat;
Line: 852

        select price_index_name , price_index_id
        from igi_iac_price_indexes
        where price_index_id = p_prc_idx;
Line: 888

        select asset_category_id
        from fa_additions
        where asset_id = X_asset_id;
Line: 893

        select cal_price_index_link_id
        from igi_iac_category_books
        where category_id = p_cat
        and   book_type_code = X_book_type_code;
Line: 906

        select deprn_calendar
        from fa_book_controls
        where book_type_code = X_book_type_code;
Line: 911

        select start_date , end_date
        from fa_calendar_periods
        where period_name = X_Period_Name
        and   calendar_type = cp_dep_cal;
Line: 917

           select current_price_index_value
           from igi_iac_cal_idx_values
           where cal_price_index_link_id = cp_cal_prc_idx_id
           and	 date_from = cp_start_date
           and   date_to   = cp_end_date;
Line: 976

    SELECT 'X'
    FROM   igi_iac_book_Controls ibc ,
           fa_book_controls bc
    WHERE  bc.book_type_code = ibc.book_type_code
    AND    bc.date_ineffective IS NULL
    AND    bc.book_type_code = X_book_type_code;
Line: 1025

	SELECT adjustment_id,
		transaction_type_code,
		transaction_header_id,
		nvl(mass_reference_id,0),
		adjustment_status
	FROM igi_iac_transaction_headers
	WHERE asset_id = x_asset_id
	AND book_type_code = x_book_type_code
	AND adjustment_id_out is null;
Line: 1036

	SELECT adjustment_id,
		transaction_type_code,
		transaction_header_id,
		nvl(mass_reference_id,0),
		adjustment_status
	FROM igi_iac_transaction_headers
	WHERE asset_id = x_asset_id
	AND book_type_code = x_book_type_code
	AND adjustment_id_out = c_adjustment_id;
Line: 1047

	SELECT max(adjustment_id)
	FROM igi_iac_transaction_headers
	WHERE asset_id = x_asset_id
	AND book_type_code = x_book_type_code
	AND transaction_type_code = X_TRANSACTION_TYPE_CODE;
Line: 1054

	SELECT transaction_header_id, nvl(mass_reference_id,0), adjustment_status
	FROM igi_iac_transaction_headers
	WHERE asset_id = x_asset_id
	AND book_type_code = x_book_type_code
	AND adjustment_id = p_adjustment_id;
Line: 1147

	SELECT  bc.accounting_flex_structure, bc.set_of_books_id
    FROM    fa_book_controls bc
	WHERE  bc.book_type_code = p_book_type_code
        	AND bc.date_ineffective IS NULL ;
Line: 1152

	SELECT currency_code
	FROM   gl_sets_of_books
	WHERE set_of_books_id = p_set_of_books_id;
Line: 1156

	SELECT Precision
	FROM fnd_currencies
	WHERE currency_code = p_currency_code;
Line: 1232

    SELECT application_column_name
    INTO   l_segment
    FROM   fnd_segment_attribute_values ,
           gl_sets_of_books sob
    WHERE  id_flex_code                    = 'GL#'
    AND    attribute_value                 = 'Y'
    AND    segment_attribute_type          = X_segment_type
    AND    application_id                  = 101
    AND    sob.chart_of_accounts_id        = id_flex_num
    AND    sob.set_of_books_id             = X_sob_id;
Line: 1243

    EXECUTE IMMEDIATE ' SELECT '||l_segment ||
                  ' FROM gl_code_combinations '||
                  ' WHERE code_combination_id = :X_ccid '
     INTO l_sel_column USING IN X_code_combination_id;
Line: 1265

	SELECT code_combination_id
	FROM fa_distribution_history
	WHERE Book_type_code = p_book_type_code
	AND	  asset_id = p_asset_id
	AND	  distribution_id = p_distribution_id;
Line: 1298

	SELECT flexbuilder_defaults_ccid
	FROM fa_book_controls
	WHERE book_type_code = p_book_type_code;
Line: 1330

       SELECT  nvl(ASSET_COST_ACCOUNT_CCID, -1),
               nvl(ASSET_CLEARING_ACCOUNT_CCID, -1),
               nvl(DEPRN_EXPENSE_ACCOUNT_CCID, -1),
               nvl(DEPRN_RESERVE_ACCOUNT_CCID, -1),
               nvl(CIP_COST_ACCOUNT_CCID, -1),
               nvl(CIP_CLEARING_ACCOUNT_CCID, -1),
               nvl(NBV_RETIRED_GAIN_CCID,-1),
               nvl(NBV_RETIRED_LOSS_CCID,-1),
               nvl(PROCEEDS_SALE_GAIN_CCID,-1),
               nvl(PROCEEDS_SALE_LOSS_CCID,-1),
               nvl(COST_REMOVAL_GAIN_CCID,-1),
               nvl(COST_REMOVAL_LOSS_CCID,-1),
               nvl(COST_REMOVAL_CLEARING_CCID,-1),
               nvl(PROCEEDS_SALE_CLEARING_CCID,-1),
               --nvl(REVAL_RSV_ACCOUNT_CCID,-1),
               --nvl(REVAL_RSV_GAIN_ACCOUNT_CCID,-1),
              -- nvl(REVAL_RSV_LOSS_ACCOUNT_CCID,-1),
               bc.accounting_flex_structure
       FROM    FA_DISTRIBUTION_ACCOUNTS da,
                    FA_BOOK_CONTROLS bc
       WHERE   bc.book_type_code = X_book_type_code
       AND     da.book_type_code = bc.book_type_code
       AND     da.distribution_id = X_distribution_id;
Line: 1355

        SELECT  'VALID'
        FROM    gl_code_combinations glcc
        WHERE   glcc.code_combination_id = Account_ccid
        AND     glcc.enabled_flag = 'Y'
        AND     nvl(glcc.end_date_active, sysdate) >= sysdate;
Line: 1362

	SELECT asset_category_id
	FROM fa_additions
	WHERE asset_id = X_asset_id;
Line: 1367

    SELECT category_id
    FROM igi_iac_transaction_headers
    Where asset_id = X_asset_id
    and book_type_code = X_book_type_code
    and adjustment_id_out is null;
Line: 1375

	SELECT  nvl(BACKLOG_DEPRN_RSV_CCID,-1),
		nvl(GENERAL_FUND_CCID,-1),
		nvl(OPERATING_EXPENSE_CCID,-1),
        nvl(REVAL_RSV_CCID,-1),
        nvl(REVAL_RSV_RET_CCID,-1)
	FROM igi_iac_category_books
	WHERE book_type_code = X_book_type_code
	AND	  category_id = p_asset_category_id;
Line: 1385

        SELECT nvl(REVAL_RESERVE_ACCOUNT_CCID,-1)
        FROM fa_category_books
        WHERE book_type_Code = X_book_type_code
        AND category_id = p_asset_category_id;
Line: 1391

        SELECT AP_INTERCOMPANY_ACCT,AR_INTERCOMPANY_ACCT
        FROM FA_BOOK_CONTROLS
        WHERE book_type_code = X_book_TYPE_Code;
Line: 1396

          SELECT deprn_reserve_acct, asset_cost_acct
          FROM FA_CATEGORY_BOOKS
          WHERE book_type_code = X_book_type_code
          AND category_id IN
                 (SELECT asset_category_id
                  FROM fa_additions
                  WHERE asset_id = X_asset_id);
Line: 1405

        SELECT nbv_retired_gain_acct,nbv_retired_loss_acct
        FROM FA_BOOK_CONTROLS
        WHERE book_type_code = X_book_type_code;
Line: 1884

    SELECT nvl(code_combination_id,-1)
    FROM   fa_adjustments
    WHERE  book_type_code = X_book_type_code
    AND    asset_id = X_asset_id
    AND    distribution_id = X_distribution_id
    AND    Transaction_header_id = X_TRANSACTION_HEADER_ID
    AND    Source_type_code = X_calling_function
    AND    Adjustment_type = c_adjustment_type;
Line: 2114

    SELECT 'X'
    FROM igi_iac_fa_deprn
    WHERE book_type_code LIKE x_book_type_code
    AND rownum = 1;
Line: 2165

        SELECT 1
        FROM dual
        WHERE EXISTS
          (SELECT 1
           FROM igi_iac_adjustments_history
           WHERE book_type_code = p_book_type_code
           AND period_counter = p_period_counter
           AND asset_id = p_asset_id
           AND nvl(current_period_amortization,'N') <> 'Y'
           AND nvl(active_flag,    'N') = 'N')
        ;