DBA Data[Home] [Help]

APPS.FA_CUA_ASSET_APIS SQL Statements

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

Line: 17

  select a.default_rule_set_id
       , a.rule_set_level
  from fa_asset_hierarchy_purpose a
     , fa_asset_hierarchy b
  where a.asset_hierarchy_purpose_id = b.asset_hierarchy_purpose_id
  and   b.asset_hierarchy_id = x_parent_node_id
  and   a.book_type_code = x_book_type_code ;
Line: 26

  select cua_rule_set_id
  from fa_category_book_defaults
  where category_id = x_cat_id_in
  and   book_type_code = x_book_type_code
  and p_rule_set_level = 'ASSET_CATEGORY'
  UNION
  select a.hierarchy_rule_set_id
  from fa_asset_hierarchy a
     , fa_asset_hierarchy_purpose b
  where a.asset_hierarchy_purpose_id = b.asset_hierarchy_purpose_id
  and   a.asset_hierarchy_id = x_parent_node_id
  and   b.book_type_code = x_book_type_code
  and p_rule_set_level = 'TOP_NODE'
  UNION
  select a.hierarchy_rule_set_id
  from  ( select hierarchy_rule_set_id, asset_hierarchy_purpose_id
          from fa_asset_hierarchy
          where parent_hierarchy_id IS NULL
          start with asset_hierarchy_id = x_parent_node_id
          connect by prior asset_hierarchy_id = parent_hierarchy_id ) a
      , fa_asset_hierarchy_purpose b
  where a.asset_hierarchy_purpose_id = b.asset_hierarchy_purpose_id
  and   b.book_type_code = x_book_type_code
  and p_rule_set_level = 'LOWEST_NODE';
Line: 118

select life_end_date
from fa_asset_hierarchy_values
where book_type_code = x_book_type_code
and asset_hierarchy_id = c_asset_hierarchy_id ;
Line: 124

select a.asset_hierarchy_id src_id
    , 'NODE' src_type
    , b.level_number hierarchy_level
    , a.book_type_code book_type_code
    , a.life_end_date life_end_date
    , 0 life_in_months
    , bc.book_class book_class
from fa_asset_hierarchy_values a,
     fa_asset_hierarchy b,
     fa_book_controls bc
where a.asset_hierarchy_id = b.asset_hierarchy_id
and   bc.book_type_code = a.book_type_code
and   a.book_type_code in (x_book_type_code,g_corporate_book)
and   b.asset_hierarchy_id in (select x_top_node_id
                               from dual
                               where nvl(x_rule_det_rec.include_level, 'ALL') = 'TOP'
                                     union
                               select x_parent_node_id
                               from dual
                               where nvl(x_rule_det_rec.include_level, 'ALL') = 'LOWEST'
                                     union
                               select d.asset_hierarchy_id
                               from fa_asset_hierarchy d
                               where nvl(x_rule_det_rec.include_level, 'ALL') = 'ALL'
                               start with d.asset_hierarchy_id = x_parent_node_id
                               connect by d.asset_hierarchy_id =  prior d.parent_hierarchy_id
                              )
and not exists (select 'X'
                  from   fa_exclude_hierarchy_levels c
                  where c.attribute_name = 'LIFE_END_DATE'
                  and   c.book_type_code= x_book_type_code
                  and   c.hierarchy_rule_set_id = x_rule_det_rec.hierarchy_rule_set_id
                  and   b.level_number = c.level_number
                 )
and nvl(x_rule_det_rec.include_hierarchy_flag,'N') = 'Y'
	 UNION ALL
--
 select asset_id src_id
    , 'ASSET' src_type
    , 0 hierarchy_level
    , book_type_code
    , add_months(prorate_date, life_in_months) life_end_date
    , life_in_months
    , 'CORPORATE' book_class
  from fa_books
  where asset_id = x_asset_id
  and date_ineffective IS NULL
  and nvl(x_rule_det_rec.include_asset_end_date_flag, 'N') = 'Y'
  and book_type_code = x_book_type_code
	  UNION ALL
--
  select lease_id src_id
       , 'LEASE' src_type
       , 0 hierarchy_level
       , null book_type_code
       , max(flp.end_date)  life_end_date
       , 0 life_in_months
       , 'CORPORATE' book_class
  from fa_lease_payments flp,fa_leases fl
  where fl.lease_id = decode(x_rule_det_rec.target_flag, 'Y', x_node_lease_id, x_asset_lease_id  )
  and nvl(x_rule_det_rec.include_lease_end_date_flag, 'N') = 'Y'
  and fl.payment_schedule_id = flp.payment_schedule_id
  group by lease_id
    , 'LEASE'
    , 0
    , null
    , 0
    , 'CORPORATE'
	  UNION ALL
--
  select category_id src_id
  , 'CATEGORY-LIFE' src_type
    , 0 hierarchy_level
    , book_type_code
    , decode( x_rule_det_rec.target_flag, 'Y',
       add_months( nvl(v_prorated_depr_date, x_prorate_date), life_in_months),
       add_months(x_prorate_date, life_in_months) ) life_end_date
    , life_in_months
    , 'CORPORATE' book_class
  from fa_category_book_defaults
  where category_id = decode(x_rule_det_rec.target_flag, 'Y', x_node_category_id, x_asset_cat_id )
  and  (trunc(sysdate) between start_dpis and nvl(end_dpis, trunc(sysdate) ) )
  and nvl(x_rule_det_rec.include_asset_catg_life_flag, 'N') = 'Y'
  and  book_type_code = x_book_type_code
	  UNION ALL
--
  select  category_id src_id
  , 'CATEGORY-LED' src_type
    , 0 hierarchy_level
    , book_type_code
    , cua_life_end_date life_end_date
    , life_in_months
    , 'CORPORATE' book_class
  from fa_category_book_defaults
  where category_id = decode(x_rule_det_rec.target_flag, 'Y', x_node_category_id, x_asset_cat_id  )
  and  (trunc(sysdate) between start_dpis and nvl(end_dpis, trunc(sysdate) ) )
  and nvl(x_rule_det_rec.include_catg_end_date_flag, 'N') = 'Y'
  and  book_type_code = x_book_type_code
  order by 7 desc;
Line: 225

  select depreciation_start_date
  from fa_asset_hierarchy
  where asset_hierarchy_id = x_parent_node_id;
Line: 329

    fa_cua_mass_update1_pkg.calc_life ( x_book_type_code
                                   , x_prorate_date
                                   , to_date( v_led, 'J')
                                   , x_deprn_method_code
                                   , x_life_out
                                   , x_err_code
                                   , x_err_stage
                                   , x_err_stack );
Line: 392

  SELECT *
  FROM FA_HIERARCHY_RULE_DETAILS a
  WHERE hierarchy_rule_set_id = p_rule_set_id
  AND   attribute_name = p_attribute_name
  AND   book_type_code = p_book_type_code;
Line: 400

  select asset_hierarchy_id
  from fa_asset_hierarchy
  where parent_hierarchy_id IS NULL
  start with asset_hierarchy_id = x_parent_node_id
  connect by asset_hierarchy_id = prior parent_hierarchy_id;
Line: 407

  select 1
  from dual
  where not exists ( select asset_hierarchy_id
                     from fa_asset_hierarchy
                     where ( parent_hierarchy_id = x_parent_node_id
                             and asset_id IS NULL)
                     OR ( asset_hierarchy_id = x_parent_node_id
                             and asset_id IS NOT NULL ) );
Line: 417

  select '1' dummy, asset_hierarchy_id
       , asset_category_id
       , lease_id
       , dist_set_id
       , asset_key_ccid
       , serial_number
       , life_end_date
  from fa_asset_hierarchy_values
  where asset_hierarchy_id = p_node_id
  and   book_type_code = x_book_type_code
  UNION
  select '2' dummy, asset_hierarchy_id
       , asset_category_id
       , lease_id
       , dist_set_id
       , asset_key_ccid
       , serial_number
       , life_end_date
  from fa_asset_hierarchy_values
  where asset_hierarchy_id = p_node_id
  and   book_type_code = g_corporate_book
  order by 1;
Line: 441

  select '1' dummy
       , nvl(x_prorate_date,prorate_date) -- Use Asset Pro Rate date if nothing passed
      , deprn_method_code
      , prorate_convention_code
      , life_in_months
  from fa_books
  where asset_id = x_asset_id
  and book_type_code = x_book_type_code
  and date_ineffective IS NULL;
Line: 452

  select '1' dummy,
         deprn_method
       , prorate_convention_code
       , life_in_months
  from fa_category_book_defaults
  where category_id = p_cat_id
  and book_type_code = x_book_type_code
  and ( trunc(sysdate) between start_dpis and nvl(end_dpis, trunc(sysdate)) )
  UNION
  select '2' dummy
       , deprn_method
       , prorate_convention_code
       , life_in_months
  from fa_category_book_defaults
  where category_id = p_cat_id
  and book_type_code = g_corporate_book
  and ( trunc(sysdate) between start_dpis and nvl(end_dpis, trunc(sysdate)) )
  ORDER BY 1;
Line: 472

  select asset_category_id
  from fa_additions
  where asset_id = x_asset_id;
Line: 477

  select lease_id
  from fa_additions
  where asset_id = x_asset_id;
Line: 482

  select book_class
  from fa_book_controls
  where book_type_code = x_book_type_code;
Line: 487

  select distribution_source_book
  from fa_book_controls
  where book_type_code = x_book_type_code;
Line: 909

               fa_cua_mass_update1_pkg.calc_life ( x_book_type_code
                                              , v_prorate_date
                                              , v_top_attr_val_rec.life_end_date
                                              , v_deprn_method_code
                                              , x_life_in_months_out
                                              , x_err_code
                                              , x_err_stage
                                              , x_err_stack );
Line: 926

              fa_cua_mass_update1_pkg.calc_life ( x_book_type_code
                                             , v_prorate_date
                                             , v_lowest_attr_val_rec.life_end_date
                                             , v_deprn_method_code
                                             , x_life_in_months_out
                                             , x_err_code
                                             , x_err_stage
                                             , x_err_stack );
Line: 1067

    SELECT *
    FROM fa_mass_update_batch_headers
    where batch_number = x_batch_number
    and status_code IN ( 'N', 'IP')
    for UPDATE NOWAIT;
Line: 1138

           update fa_mass_update_batch_headers
           set status_code = 'P',
           rejection_reason_code = null
           where batch_id = hdr_rec.batch_id;
Line: 1143

           update fa_mass_update_batch_headers
           set status_code = 'CP',
           rejection_reason_code = null
           where batch_id = hdr_rec.batch_id;
Line: 1161

       update fa_mass_update_batch_headers
       set status_code = 'R',
       rejection_reason_code = v_message_name
       where batch_number = x_batch_number ;
Line: 1172

       update fa_mass_update_batch_headers
       set status_code = 'R',
       rejection_reason_code = v_message_name
       where batch_number = x_batch_number ;
Line: 1219

v_last_update_login NUMBER;
Line: 1220

v_last_updated_by NUMBER;
Line: 1263

v_insert_flag                  VARCHAR2(1):= 'N';
Line: 1267

  select book_class
  from fa_book_controls
  where book_type_code = x_book_type_code;
Line: 1280

  v_last_updated_by:= v_created_by;
Line: 1281

  v_last_update_login:= nvl(TO_NUMBER(fnd_profile.value('LOGIN_ID')),-1);
Line: 1326

  x_err_stage:= 'Calling insert_mass_update_batch_headers';
Line: 1327

  FA_CUA_DERIVE_ASSET_ATTR_PKG.insert_mass_update_batch_hdrs (
             x_event_code
           , x_book_type_code
           , 'P'
           , x_src_entity_name
           , x_src_entity_value
           , v_src_attribute_name
           , v_src_attr_value_from
           , v_src_attr_value_to
           , NULL  -- x_description
           , x_amortize_expense_flg
           , x_amortization_date
           , v_rejection_reason_code
           , v_conc_request_id
           , v_created_by
           , v_sysdate -- creation_date
           , v_last_updated_by
           , v_sysdate  -- last_update_date
           , v_last_update_login
           , x_batch_num
           , x_batch_id
           , x_transaction_name
           , x_attribute_category
           , x_attribute1
           , x_attribute2
           , x_attribute3
           , x_attribute4
           , x_attribute5
           , x_attribute6
           , x_attribute7
           , x_attribute8
           , x_attribute9
           , x_attribute10
           , x_attribute11
           , x_attribute12
           , x_attribute13
           , x_attribute14
           , x_attribute15
           , x_err_code
           , x_err_stage
           , x_err_stack );
Line: 1374

  x_err_stage:= 'Calling select_assets';
Line: 1376

  FA_CUA_DERIVE_ASSET_ATTR_PKG.select_assets( x_event_code
               , x_book_type_code
               , v_book_class
               , x_src_entity_value
               , v_parent_id  -- new parent id in case of HR_MASS_TRANSFER
               , v_asset_attr_tab
               , x_err_code
               , x_err_stage
               , x_err_stack );
Line: 1386

     update fa_mass_update_batch_headers
     set status_code = 'R',
        rejection_reason_code = x_err_code
     where batch_id = x_batch_id;
Line: 1450

     x_err_stage:= 'Insert_mass_update_batch_details: asset_category';
Line: 1451

     FA_CUA_DERIVE_ASSET_ATTR_PKG.insert_mass_update_batch_dtls(
              x_batch_id
            , x_book_type_code
            , 'CATEGORY'
            , v_asset_attr_tab(i).asset_id
            , to_char(v_asset_attr_tab(i).asset_category_id)
            , to_char(v_cat_id_out)
            , 'NODE' --x_derived_from_entity_type
            , g_derived_from_entity_rec.category -- x_derived_from_entity_id
            , v_asset_attr_tab(i).parent_hierarchy_id_old
            , v_status_code
            , NULL --v_rejection_reason_code
            , 'Y'  --x_apply_flag
            , NULL --x_effective_date
            , NULL --x_fa_period_name
            , v_conc_request_id
            , v_created_by
            , v_sysdate
            , v_last_updated_by
            , v_sysdate
            , v_last_update_login
            , x_err_code
            , x_err_stage
            , x_err_stack );
Line: 1482

      x_err_stage:= 'Insert_mass_update_batch_details: lease_number';
Line: 1483

     FA_CUA_DERIVE_ASSET_ATTR_PKG.insert_mass_update_batch_dtls(
             x_batch_id
           , x_book_type_code
           , 'LEASE_NUMBER'
           , v_asset_attr_tab(i).asset_id
           , to_char(v_asset_attr_tab(i).lease_id)
           , to_char(v_lease_id_out)
           , 'NODE' --x_derived_from_entity_type
           , g_derived_from_entity_rec.lease
           , v_asset_attr_tab(i).parent_hierarchy_id_old
           , v_status_code
           , NULL --x_rejection_reason_code
           , 'Y' --x_apply_flag
           , NULL --x_effective_date
           , NULL --x_fa_period_name
           , v_conc_request_id
           , v_created_by
           , v_sysdate
           , v_last_updated_by
           , v_sysdate
           , v_last_update_login
           , x_err_code
           , x_err_stage
           , x_err_stack );
Line: 1514

          select count(*) into v_dist_count
          from fa_hierarchy_distributions
          where dist_set_id = v_distribution_set_id_out;
Line: 1522

              select count(*)
              into v_dist_count2
              from fa_distribution_history fmd
                 , fa_hierarchy_distributions ihd
                 , fa_additions a
              where fmd.asset_id = v_asset_attr_tab(i).asset_id
              and fmd.asset_id = a.asset_id
              and   fmd.date_ineffective is null
              and   ihd.dist_set_id = v_distribution_set_id_out
              and   ROUND(ihd.distribution_line_percentage, 2)
                          ||ihd.code_combination_id||ihd.location_id||ihd.assigned_to
                  = ROUND((fmd.units_assigned * 100/a.current_units), 2)
                          ||fmd.code_combination_id||fmd.location_id||fmd.assigned_to;
Line: 1539

           x_err_stage:= 'Insert_mass_update_batch_details: distribution_set';
Line: 1540

           FA_CUA_DERIVE_ASSET_ATTR_PKG.insert_mass_update_batch_dtls(
              x_batch_id
            , x_book_type_code
            , 'DISTRIBUTION'
            , v_asset_attr_tab(i).asset_id
            , NULL -- x_attribute_old_id; old dist_set_id is passed as null
Line: 1558

            , v_last_updated_by
            , v_sysdate
            , v_last_update_login
            , x_err_code
            , x_err_stage
            , x_err_stack );
Line: 1573

    x_err_stage:= 'Insert_mass_update_batch_details: serial_number';
Line: 1574

    FA_CUA_DERIVE_ASSET_ATTR_PKG.insert_mass_update_batch_dtls(
             x_batch_id
           , x_book_type_code
           , 'SERIAL_NUMBER'
           , v_asset_attr_tab(i).asset_id
           , v_asset_attr_tab(i).serial_number
           , v_serial_number_out
           , 'NODE' --x_derived_from_entity_type
           , g_derived_from_entity_rec.serial_number
           , v_asset_attr_tab(i).parent_hierarchy_id_old
           , v_status_code
           , v_rejection_reason_code
           , 'Y' --x_apply_flag
           , NULL --x_effective_date
           , NULL --x_fa_period_name
           , v_conc_request_id
           , v_created_by
           , v_sysdate
           , v_last_updated_by
           , v_sysdate
           , v_last_update_login
           , x_err_code
           , x_err_stage
           , x_err_stack );
Line: 1605

    x_err_stage:= 'Insert_mass_update_batch_details: asset_key';
Line: 1606

    FA_CUA_DERIVE_ASSET_ATTR_PKG.insert_mass_update_batch_dtls(
             x_batch_id
           , x_book_type_code
           , 'ASSET_KEY'
           , nvl(v_asset_attr_tab(i).asset_id, 0)
           , to_char(nvl(v_asset_attr_tab(i).asset_key_ccid, 0))
           , to_char(nvl(v_asset_key_ccid_out, 0))
           , 'NODE' --x_derived_from_entity_type
           , g_derived_from_entity_rec.asset_key
           , v_asset_attr_tab(i).parent_hierarchy_id_old
           , v_status_code
           , v_rejection_reason_code
           , 'Y' --x_apply_flag
           , NULL --x_effective_date
           , NULL --x_fa_period_name
           , v_conc_request_id
           , v_created_by
           , v_sysdate
           , v_last_updated_by
           , v_sysdate
           , v_last_update_login
           , x_err_code
           , x_err_stage
           , x_err_stack );
Line: 1637

    x_err_stage:= 'Insert_mass_update_batch_details: life_end_date';
Line: 1638

    FA_CUA_DERIVE_ASSET_ATTR_PKG.insert_mass_update_batch_dtls(
             x_batch_id
           , x_book_type_code
           , 'LIFE_END_DATE'
           , nvl(v_asset_attr_tab(i).asset_id, 0)
           , to_char(nvl(v_asset_attr_tab(i).life_in_months, 0))
           , to_char(nvl(v_life_in_months_out, 0))
           , g_derived_from_entity_rec.lim_type --x_derived_from_entity_type
           , g_derived_from_entity_rec.life_in_months
           , v_asset_attr_tab(i).parent_hierarchy_id_old
           , v_status_code
           , v_rejection_reason_code
           , 'Y' --x_apply_flag
           , NULL --x_effective_date
           , NULL --x_fa_period_name
           , v_conc_request_id
           , v_created_by
           , v_sysdate
           , v_last_updated_by
           , v_sysdate
           , v_last_update_login
           , x_err_code
           , x_err_stage
           , x_err_stack );
Line: 1717

   select book_type_code
   from fa_book_controls
   where ( (book_type_code = x_book_type_code)
   OR (distribution_source_book = x_book_type_code) )
   and book_class IN ( 'CORPORATE', 'TAX')
   order by book_class;
Line: 1819

       update fa_mass_update_batch_headers
       set status_code = 'CP'
       where batch_id = x_batch_id;
Line: 1909

    select batch_id
    from fa_mass_update_batch_headers
    where book_type_code = x_book_type_code
    and   batch_id = nvl(x_batch_id, batch_id)
    and status_code = 'C'
    for update NOWAIT;
Line: 1920

          Delete from fa_mass_update_batch_details
          where batch_id = C1_rec.batch_id;
Line: 1923

          Delete from fa_mass_update_batch_headers
          where batch_id = C1_rec.batch_id;
Line: 1954

 select parent_hierarchy_id
 from fa_asset_hierarchy
 where asset_id = p_asset_id;
Line: 1982

  select asset_category_id
  into v_asset_cat_id
  from fa_additions
  where asset_id = p_asset_id;