DBA Data[Home] [Help]

APPS.FEM_BR_MAPPING_RULE_PVT SQL Statements

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

Line: 26

PROCEDURE DeleteBrObjectRec(
  p_obj_id          in          number
);
Line: 30

PROCEDURE DeleteHelperRecs(
  p_obj_def_id          in          number
);
Line: 34

PROCEDURE DeleteMappingRuleRec(
  p_obj_def_id          in          number
);
Line: 38

PROCEDURE DeleteFormulaRecs(
  p_obj_def_id          in          number
);
Line: 42

PROCEDURE DeleteDimensionRecs(
  p_obj_def_id          in          number
);
Line: 88

PROCEDURE delete_dimension_rec (
  p_obj_def_id in number
  ,p_func_seq in number);
Line: 130

PROCEDURE DeleteObjectDetails (
  p_obj_id              in          number
)

IS
  g_api_name    constant varchar2(30)   := 'DeleteObjectDetails';
Line: 139

   DeleteBrObjectRec (
      p_obj_id => p_obj_id
   );
Line: 149

END DeleteObjectDetails;
Line: 162

PROCEDURE DeleteObjectDefinition(
  p_obj_def_id          in          number
)
--------------------------------------------------------------------------------
IS

  l_api_name    constant varchar2(30)   := 'DeleteObjectDefinition';
Line: 180

   DeleteHelperRecs(
    p_obj_def_id     => p_obj_def_id
  );
Line: 187

     ,p_msg_text => 'After DeleteHelperRecs'
   );
Line: 190

  DeleteDimensionRecs(
    p_obj_def_id     => p_obj_def_id
  );
Line: 197

    ,p_msg_text => 'After DeleteDimensionRecs'  );
Line: 199

  DeleteFormulaRecs(
    p_obj_def_id     => p_obj_def_id
  );
Line: 205

    ,p_msg_text => 'After DeleteFormulaRecs'  );
Line: 207

  DeleteMappingRuleRec(
    p_obj_def_id     => p_obj_def_id
  );
Line: 214

    ,p_msg_text => 'After DeleteMappingRuleRec'  );
Line: 235

END DeleteObjectDefinition;
Line: 367

    select object_definition_id
    from fem_object_definition_b
    where object_id = p_obj_id
    and old_approved_copy_flag = 'N';
Line: 408

  select sub_object_id
  into l_cond_id
  from fem_alloc_br_formula
  where object_definition_id = p_obj_def_id
  and function_seq = p_func_seq;
Line: 440

PROCEDURE DeleteHelperRecs(
  p_obj_def_id in number
)
--------------------------------------------------------------------------------
IS
  v_return_status VARCHAR2(1);
Line: 452

 SELECT helper_obj_def_id, helper_object_id, helper_object_type_code
    FROM fem_objdef_helper_rules
    WHERE object_definition_id = p_rule_def_id
    AND helper_obj_def_id NOT IN (select helper_obj_def_id
    FROM fem_objdef_helper_rules
    WHERE object_definition_id <> p_rule_def_id);
Line: 466

   FEM_BUSINESS_RULE_PVT.DeleteObjectDefinition (
      p_api_version                   => 1.0,
      p_init_msg_list                => FND_API.G_FALSE,
      p_commit                       => FND_API.G_FALSE,
      x_return_status                => v_return_status,
      x_msg_count                    => v_msg_count,
      x_msg_data                     => v_msg_data,
      p_object_type_code             => helper_rule.helper_object_type_code,
      p_obj_def_id                   => helper_rule.helper_obj_def_id);
Line: 484

   /*  Have we deleted the last object definition for this helper object?
        If so - delete the helper object also*/
   SELECT count(*)
   INTO v_count
   FROM fem_object_definition_b
   WHERE object_id = helper_rule.helper_object_id;
Line: 493

      FEM_BUSINESS_RULE_PVT.DeleteObject (
        p_api_version                   => 1.0,
        p_init_msg_list                => FND_API.G_FALSE,
        p_commit                       => FND_API.G_FALSE,
        x_return_status                => v_return_status,
        x_msg_count                    => v_msg_count,
        x_msg_data                     => v_msg_data,
        p_object_type_code             => helper_rule.helper_object_type_code,
        p_obj_id                       => helper_rule.helper_object_id);
Line: 515

   /* Last step - delete all of the helper rule registrations for the object def
     being deleted*/
   DELETE FROM fem_objdef_helper_rules
   WHERE object_definition_id = p_obj_def_id;
Line: 521

END DeleteHelperRecs;
Line: 534

PROCEDURE DeleteBrObjectRec(
  p_obj_id in number
)
--------------------------------------------------------------------------------
IS
BEGIN

  delete from fem_alloc_br_objects
  where map_rule_object_id = p_obj_id;
Line: 544

END DeleteBrObjectRec;
Line: 559

PROCEDURE DeleteMappingRuleRec(
  p_obj_def_id in number
)
--------------------------------------------------------------------------------
IS
BEGIN

  delete from fem_alloc_business_rule
  where object_definition_id = p_obj_def_id;
Line: 569

END DeleteMappingRuleRec;
Line: 584

PROCEDURE DeleteFormulaRecs(
  p_obj_def_id in number
)
--------------------------------------------------------------------------------
IS
  CURSOR c_local_cond_id (p_rule_def_id NUMBER)
  IS
    select sub_object_id
    from fem_alloc_br_formula formula
    where formula.object_definition_id = p_rule_def_id
    and exists (select 1
               from fem_object_catalog_b obj
               where obj.object_id = formula.sub_object_id
               and obj.object_type_code = 'CONDITION_MAPPING');
Line: 604

    l_api_name             constant varchar2(30) := 'DeleteFormulaRecs';
Line: 621

      ,p_msg_text => 'Before calling FEM_BUSINESS_RULE_PVT.DeleteObject, l_local_cond_id: '
       || l_local_cond_id
     );
Line: 624

    FEM_BUSINESS_RULE_PVT.DeleteObject (
      p_api_version                   => 1.0
      ,p_init_msg_list                => FND_API.G_FALSE
      ,p_commit                       => FND_API.G_FALSE
      ,x_return_status                => l_return_status
      ,x_msg_count                    => l_msg_count
      ,x_msg_data                     => l_msg_data
      ,p_object_type_code             => 'CONDITION_MAPPING'
      ,p_obj_id                       => l_local_cond_id
    );
Line: 638

      ,p_msg_text => 'After calling FEM_BUSINESS_RULE_PVT.DeleteObject, l_local_cond_id: '
       || l_local_cond_id
     );
Line: 646

         ,p_msg_text => 'After calling FEM_BUSINESS_RULE_PVT.DeleteObject, l_return_status = FND_API.G_RET_STS_ERROR '
        );
Line: 655

         ,p_msg_text => 'After calling FEM_BUSINESS_RULE_PVT.DeleteObject, l_return_status = FND_API.G_RET_STS_UNEXP_ERROR '
      );
Line: 670

  delete from fem_alloc_br_formula
  where object_definition_id = p_obj_def_id;
Line: 679

END DeleteFormulaRecs;
Line: 694

PROCEDURE DeleteDimensionRecs(
  p_obj_def_id in number
)
--------------------------------------------------------------------------------
IS
BEGIN

  delete from fem_alloc_br_dimensions
  where object_definition_id = p_obj_def_id;
Line: 704

END DeleteDimensionRecs;
Line: 731

  insert into fem_alloc_br_objects (
     MAP_RULE_OBJECT_ID
     ,MAP_RULE_TYPE_CODE
     ,OBJECT_VERSION_NUMBER
     ,CREATION_DATE
     ,CREATED_BY
     ,LAST_UPDATED_BY
     ,LAST_UPDATE_DATE
     ,LAST_UPDATE_LOGIN
  ) select
     p_target_obj_id
     ,MAP_RULE_TYPE_CODE
     ,OBJECT_VERSION_NUMBER
    ,nvl(p_creation_date,creation_date)
    ,nvl(p_created_by,created_by)
    ,FND_GLOBAL.user_id
    ,sysdate
    ,FND_GLOBAL.login_id
  from fem_alloc_br_objects
  where map_rule_object_id = p_source_obj_id;
Line: 781

  insert into fem_alloc_business_rule (
    object_definition_id
    ,cost_contribution_flag
    ,accumulate_flag
    /*,source_where_clause
    ,driver_where_clause*/
    ,formula
    ,created_by
    ,creation_date
    ,last_updated_by
    ,last_update_date
    ,last_update_login
    ,object_version_number
  ) select
    p_target_obj_def_id
    ,cost_contribution_flag
    ,accumulate_flag
    /*,source_where_clause
    ,driver_where_clause*/
    ,formula
    ,nvl(p_created_by,created_by)
    ,nvl(p_creation_date,creation_date)
    ,FND_GLOBAL.user_id
    ,sysdate
    ,FND_GLOBAL.login_id
    ,object_version_number
  from fem_alloc_business_rule
  where object_definition_id = p_source_obj_def_id;
Line: 839

    select
    p_target_obj_def_id object_definition_id
    ,function_seq
    ,function_cd
    ,sub_object_id
    ,value
    ,table_name
    ,column_name
    ,math_operator_cd
    ,formula_macro_cd
    ,force_to_100_flg
    ,enable_flg
    ,post_to_ledger_flg
    ,open_paren
    ,close_paren
    ,apply_to_debit_code
    ,nvl(p_created_by,created_by) created_by
    ,nvl(p_creation_date,creation_date) creation_date
    ,FND_GLOBAL.user_id last_updated_by
    ,sysdate last_update_date
    ,FND_GLOBAL.login_id LAST_UPDATE_LOGIN
    ,object_version_number
    from fem_alloc_br_formula formula
    where formula.object_definition_id = p_obj_def_id
    and exists (select 1
               from fem_object_catalog_b obj
               where obj.object_id = formula.sub_object_id
               and obj.object_type_code = 'CONDITION_MAPPING');
Line: 888

  insert into fem_alloc_br_formula (
    object_definition_id
    ,function_seq
    ,function_cd
    ,sub_object_id
    ,value
    ,table_name
    ,column_name
    ,math_operator_cd
    ,formula_macro_cd
    ,force_to_100_flg
    ,enable_flg
    ,post_to_ledger_flg
    ,open_paren
    ,close_paren
    ,apply_to_debit_code
    ,created_by
    ,creation_date
    ,last_updated_by
    ,last_update_date
    ,last_update_login
    ,object_version_number
  ) select
    p_target_obj_def_id
    ,function_seq
    ,function_cd
    ,sub_object_id
    ,value
    ,table_name
    ,column_name
    ,math_operator_cd
    ,formula_macro_cd
    ,force_to_100_flg
    ,enable_flg
    ,post_to_ledger_flg
    ,open_paren
    ,close_paren
    ,apply_to_debit_code
    ,nvl(p_created_by,f.created_by)
    ,nvl(p_creation_date,f.creation_date)
    ,FND_GLOBAL.user_id
    ,sysdate
    ,FND_GLOBAL.login_id
    ,f.object_version_number
  from fem_alloc_br_formula f
  where f.object_definition_id = p_source_obj_def_id
  and (f.sub_object_id is NULL
       or NOT EXISTS (select 1
                      from fem_object_catalog_b o
                      where o.object_id  = f.sub_object_id
                      and o.object_type_code  = 'CONDITION_MAPPING'));
Line: 1035

    insert into fem_alloc_br_formula (
      object_definition_id
      ,function_seq
      ,function_cd
      ,sub_object_id
      ,value
      ,table_name
      ,column_name
      ,math_operator_cd
      ,formula_macro_cd
      ,force_to_100_flg
      ,enable_flg
      ,post_to_ledger_flg
      ,open_paren
      ,close_paren
      ,apply_to_debit_code
      ,created_by
      ,creation_date
      ,last_updated_by
      ,last_update_date
      ,last_update_login
      ,object_version_number
      ) values (
      l_formula_rec.object_definition_id
      ,l_formula_rec.function_seq
      ,l_formula_rec.function_cd
      ,l_target_cond_obj_id
      ,l_formula_rec.value
      ,l_formula_rec.table_name
      ,l_formula_rec.column_name
      ,l_formula_rec.math_operator_cd
      ,l_formula_rec.formula_macro_cd
      ,l_formula_rec.force_to_100_flg
      ,l_formula_rec.enable_flg
      ,l_formula_rec.post_to_ledger_flg
      ,l_formula_rec.open_paren
      ,l_formula_rec.close_paren
      ,l_formula_rec.apply_to_debit_code
      ,l_formula_rec.created_by
      ,l_formula_rec.creation_date
      ,l_formula_rec.last_updated_by
      ,l_formula_rec.last_update_date
      ,l_formula_rec.last_update_login
      ,l_formula_rec.object_version_number
      );
Line: 1083

      update fem_object_dependencies
      set required_object_id = l_target_cond_obj_id
      where object_definition_id = l_formula_rec.object_definition_id
      and required_object_id = l_source_cond_obj_id;
Line: 1129

  insert into fem_alloc_br_dimensions (
    object_definition_id
    ,function_seq
    ,alloc_dim_col_name
    ,post_to_balances_flag
    ,function_cd
    ,alloc_dim_usage_code
   /* ,hierarchy_obj_def_id
    ,alloc_dim_track_flag*/
    ,dimension_value
    ,dimension_value_char
    ,percent_distribution_code
    ,created_by
    ,creation_date
    ,last_updated_by
    ,last_update_date
    ,last_update_login
    ,object_version_number
  ) select
    p_target_obj_def_id
    ,function_seq
    ,alloc_dim_col_name
    ,post_to_balances_flag
    ,function_cd
    ,alloc_dim_usage_code
   /* ,hierarchy_obj_def_id
    ,alloc_dim_track_flag*/
    ,dimension_value
    ,dimension_value_char
    ,percent_distribution_code
    ,nvl(p_created_by,created_by)
    ,nvl(p_creation_date,creation_date)
    ,FND_GLOBAL.user_id
    ,sysdate
    ,FND_GLOBAL.login_id
    ,object_version_number
  from fem_alloc_br_dimensions
  where object_definition_id = p_source_obj_def_id;
Line: 1218

    select function_seq, function_cd, table_name, nvl (post_to_ledger_flg, 'N') as post_to_ledger_flg
    from FEM_ALLOC_BR_FORMULA
    where object_definition_id = p_obj_def_id
    and function_cd in ('FILTER', 'DEBIT', 'CREDIT',
     'TABLE_ACCESS', 'PCT_DISTRB', 'LEAFFUNC')
    order by function_seq asc;
Line: 1324

        update FEM_ALLOC_BR_FORMULA set table_name = L_DEFAULT_TABLE,
               column_name = l_col_name, sub_object_id = null
        where object_definition_id = p_obj_def_id
        and function_seq = l_formula_rec.function_seq;
Line: 1329

        delete_dimension_rec (
          p_obj_def_id => p_obj_def_id
          ,p_func_seq => l_formula_rec.function_seq);
Line: 1413

     select 1
     FROM fem_table_class_assignmt tc, fem_table_class_usages tu
     where tu.table_classification_code =   tc.table_classification_code
           and tc.enabled_flag = 'Y'
           and tc.table_name = p_table_name;
Line: 1431

PROCEDURE delete_dimension_rec (
  p_obj_def_id in number
  ,p_func_seq in number)
IS
BEGIN
  delete from fem_alloc_br_dimensions
  where object_definition_id = p_obj_def_id
  and function_seq = p_func_seq;
Line: 1458

  select column_name
  from fem_tab_column_prop
  where column_property_code = p_column_property_code
  and table_name = p_table_name;
Line: 1472

    insert into fem_alloc_br_dimensions (
      object_definition_id
      ,function_seq
      ,alloc_dim_col_name
      ,post_to_balances_flag
      ,function_cd
      ,alloc_dim_usage_code
      ,dimension_value
      ,dimension_value_char
      ,percent_distribution_code
      ,created_by
      ,creation_date
      ,last_updated_by
      ,last_update_date
      ,last_update_login
      ,object_version_number)
    values
      (p_obj_def_id
      ,p_func_seq
      ,l_dimension_candidate.column_name
      ,p_post_to_balance_flag
      ,p_function_cd
      ,p_alloc_dim_usage_code
      ,null
      ,null
      ,p_percent_distribution_code
      ,FND_GLOBAL.User_ID
      ,l_date
      ,FND_GLOBAL.User_ID
      ,l_date
      ,FND_GLOBAL.Conc_Login_ID
      ,1.0);
Line: 1521

  select alloc_dim_col_name, alloc_dim_usage_code
  from fem_alloc_br_dimensions
  where object_definition_id = p_obj_def_id
  and function_seq = p_func_seq
  and alloc_dim_col_name not in
  (select column_name
  from fem_tab_column_prop
  where column_property_code = p_column_property_code
  and table_name = p_table_name);
Line: 1535

  select column_name
  from fem_tab_column_prop
  where column_property_code = p_column_property_code
  and table_name = p_table_name
  and column_name not in (select alloc_dim_col_name
  from fem_alloc_br_dimensions
  where object_definition_id = p_obj_def_id
  and function_seq = p_func_seq);
Line: 1551

       delete from fem_alloc_br_dimensions
       where object_definition_id = p_obj_def_id
       and function_seq = p_func_seq
       and alloc_dim_col_name = l_orphan_dimensions_rec.alloc_dim_col_name;
Line: 1559

           update fem_alloc_br_dimensions
           set percent_distribution_code = 'NOT_APPLICABLE'
           where object_definition_id = p_obj_def_id
           and alloc_dim_col_name = l_orphan_dimensions_rec.alloc_dim_col_name
           and function_cd = 'PCT_DISTRB'
           and percent_distribution_code in ('PERCENT_DISTRIBUTION', 'MATCHING_DIMENSION');
Line: 1574

       insert into fem_alloc_br_dimensions (
         object_definition_id
         ,function_seq
         ,alloc_dim_col_name
         ,post_to_balances_flag
         ,function_cd
         ,alloc_dim_usage_code
         ,dimension_value
         ,dimension_value_char
         ,percent_distribution_code
         ,created_by
         ,creation_date
         ,last_updated_by
         ,last_update_date
         ,last_update_login
         ,object_version_number)
       values
         (p_obj_def_id
         ,p_func_seq
         ,l_missing_dimensions_rec.column_name
         ,p_post_to_balance_flag
         ,p_function_cd
         ,p_alloc_dim_usage_code
         ,null
         ,null
         ,p_percent_distribution_code
         ,FND_GLOBAL.User_ID
         ,l_date
         ,FND_GLOBAL.User_ID
         ,l_date
         ,FND_GLOBAL.Conc_Login_ID
         ,1.0);
Line: 1613

                         delete_map_rule_content
	This procedure deletes the data from the 3 tables that store
	the mapping rule content viz. FEM_ALLOC_BUSINESS_RULE,
	FEM_ALLOC_BR_FORMULA and FEM_ALLOC_BR_DIMENSIONS.

*************************************************************************/

PROCEDURE  delete_map_rule_content(p_object_definition_id IN NUMBER)
IS
  c_api_name constant varchar2(30)   := ' delete_map_rule_content';
Line: 1626

  DeleteDimensionRecs(
    p_obj_def_id     => p_object_definition_id
  );
Line: 1630

  DeleteFormulaRecs(
    p_obj_def_id     => p_object_definition_id
  );
Line: 1634

  DeleteMappingRuleRec(
    p_obj_def_id     => p_object_definition_id
  );
Line: 1644

END  delete_map_rule_content;
Line: 1659

PROCEDURE DeleteTuningOptionDetails(
  p_obj_id in number
)
--------------------------------------------------------------------------------
IS

    l_return_status varchar2(1);
Line: 1670

    FEM_ADMIN_UTIL_PKG.Delete_Obj_Tuning_Options (
      p_api_version                   => 1.0
      ,p_init_msg_list                => FND_API.G_FALSE
      ,p_commit                       => FND_API.G_FALSE
      ,p_encoded                      => FND_API.G_FALSE
      ,x_return_status                => l_return_status
      ,x_msg_count                    => l_msg_count
      ,x_msg_data                     => l_msg_data
      ,p_object_id                    => p_obj_id
    );
Line: 1681

END DeleteTuningOptionDetails;