DBA Data[Home] [Help]

APPS.AME_UTILITY_PKG SQL Statements

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

Line: 94

    /* insert,update,delete,commit,rollback   */
    /* truncate,drop,grant,execute,locl,alter */
    if instr(lower(temp_query_string),' insert ',1,1) > 0 then
      fnd_message.set_name('PER','AME_400630_PROHIBITED_KEYWORD');
Line: 98

      fnd_message.set_token('KEYWORD','INSERT');
Line: 101

    if instr(lower(temp_query_string),' update ',1,1) > 0 then
      fnd_message.set_name('PER','AME_400630_PROHIBITED_KEYWORD');
Line: 103

      fnd_message.set_token('KEYWORD','UPDATE');
Line: 106

    if instr(lower(temp_query_string),' delete ',1,1) > 0 then
      fnd_message.set_name('PER','AME_400630_PROHIBITED_KEYWORD');
Line: 108

      fnd_message.set_token('KEYWORD','DELETE');
Line: 293

      select dynamic_description
        from ame_action_types aty,
             ame_actions act
       where act.action_id = actionIdIn
         and act.action_type_id = aty.action_type_id
         and p_effective_date between act.start_date and nvl(act.end_date - (1/86400), p_effective_date)
         and p_effective_date between aty.start_date and nvl(aty.end_date - (1/86400), p_effective_date);
Line: 303

      select description
        from ame_actions_vl
       where action_id = actionIdIn
         and p_effective_date between start_date and nvl(end_date - (1/86400), p_effective_date);
Line: 310

      select description_query,
             parameter,
             parameter_two
        from ame_action_types aty,
             ame_actions act
       where act.action_id = actionIdIn
         and act.action_type_id = aty.action_type_id
         and p_effective_date between act.start_date and nvl(act.end_date - (1/86400), p_effective_date)
         and p_effective_date between aty.start_date and nvl(aty.end_date - (1/86400), p_effective_date);
Line: 387

    select name into l_name
      from ame_action_types
     where action_type_id = p_action_type_id
       and sysdate between start_date and nvl(end_date-(1/86400),sysdate)
       and rownum < 2;
Line: 396

        select 'Y' into l_return_value
          from wf_roles wfroles
	       ,ame_actions act
         where wfroles.name = act.parameter
           and wfroles.status = 'ACTIVE'
           and (wfroles.expiration_date is null or
                                 sysdate < wfroles.expiration_date)
           and act.action_type_id = p_action_type_id
	   and act.action_id = p_action_id
	   and sysdate between act.start_date and nvl(act.end_date-(1/86400),sysdate)
	   and rownum < 2;
Line: 427

      select application_id into l_application_id
        from ame_calling_apps_vl
       where upper(trim(application_name)) = upper(trim(p_transaction_type))
         and sysdate between start_date and nvl(end_date-(1/86400),sysdate);
Line: 434

      select count(*)
        into l_count
        from ame_exceptions_log
       where application_id = l_application_id ;
Line: 439

        delete from ame_exceptions_log
         where application_id = l_application_id ;
Line: 446

      select count(*)
        into l_count
        from ame_exceptions_log
       where transaction_id like (p_transaction_id || '%');
Line: 451

        delete from ame_exceptions_log
         where transaction_id like (p_transaction_id || '%');
Line: 458

      select count(*)
       into l_count
       from ame_exceptions_log
      where transaction_id like (p_transaction_id || '%')
        and application_id = l_application_id ;
Line: 464

        delete from ame_exceptions_log
         where application_id = l_application_id
          and transaction_id like (p_transaction_id || '%');
Line: 486

      select attr.name
            ,attr.attribute_type
            ,attr.approver_type_id
            ,cond.parameter_one
            ,cond.parameter_two
            ,cond.parameter_three
            ,cond.include_lower_limit
            ,cond.include_upper_limit
            ,cond.condition_type
        from ame_conditions cond
            ,(select name
                    ,attribute_id
                    ,attribute_type
                    ,approver_type_id
                from ame_attributes
               where p_effective_date between start_date
                                 and nvl(end_date,p_effective_date)
             ) attr
       where cond.condition_id = p_condition_id
         and cond.attribute_id = attr.attribute_id (+)
         and p_effective_date between cond.start_date
                         and nvl(cond.end_date-(1/86400),p_effective_date);
Line: 511

      select strval.string_value
        from ame_string_values strval
       where strval.condition_id = p_condition_id
         and p_effective_date between strval.start_date
                         and nvl(strval.end_date-(1/86400),p_effective_date)
          order by strval.string_value;
Line: 691

        select lookup.meaning ||': '||wfroles.display_name
          into l_string_value
          from ame_approver_types appr
              ,fnd_lookups lookup
              ,wf_roles wfroles
         where appr.approver_type_id = l_approver_type_id
           and lookup.lookup_type = 'FND_WF_ORIG_SYSTEMS'
           and lookup.lookup_code = appr.orig_system
           and p_effective_date between appr.start_date
                           and nvl(appr.end_date-(1/86400),p_effective_date)
           and wfroles.orig_system = appr.orig_system
           and to_char(wfroles.orig_system_id) = l_parameter_one
           and wfroles.status = 'ACTIVE'
           and (wfroles.expiration_date is null or
                                p_effective_date < wfroles.expiration_date);
Line: 709

            select lookup.meaning ||': '||wfroles.display_name
              into l_string_value
              from ame_approver_types appr
                  ,fnd_lookups lookup
                  ,wf_local_roles wfroles
             where appr.approver_type_id = l_approver_type_id
               and lookup.lookup_type = 'FND_WF_ORIG_SYSTEMS'
               and lookup.lookup_code = appr.orig_system
               and p_effective_date between appr.start_date
                             and nvl(appr.end_date-(1/86400),p_effective_date)
               and wfroles.orig_system = appr.orig_system
               and to_char(wfroles.orig_system_id) = l_parameter_one
	       and rownum < 2;
Line: 733

              select lookup.meaning ||': '|| l_parameter_one
                into l_string_value
                from ame_approver_types appr
                    ,fnd_lookups lookup
               where appr.approver_type_id = l_approver_type_id
                 and lookup.lookup_type = 'FND_WF_ORIG_SYSTEMS'
                 and lookup.lookup_code = appr.orig_system
                 and p_effective_date between appr.start_date
                             and nvl(appr.end_date-(1/86400),p_effective_date)
                 and rownum < 2;
Line: 766

      select act.name
        from ame_action_types act,
             ame_mandatory_attributes man
       where Man.action_type_id = Act.action_type_id
         and sysdate between act.start_date and nvl(act.end_date,sysdate)
         and sysdate between man.start_date and nvl(man.end_date,sysdate)
         and man.attribute_id = l_attribute_id
       order by act.name;
Line: 806

      select man.action_type_id
        from ame_attributes atr,
             ame_mandatory_attributes man
       where atr.attribute_id = man.attribute_id
         and atr.attribute_id = l_attribute_id
         and sysdate between atr.start_date and nvl(atr.end_date-(1/84600),sysdate)
         and sysdate between man.start_date and nvl(man.end_date-(1/84600),sysdate);
Line: 852

    ,p_select          out nocopy varchar2) is
    l_select            varchar2(4000);
Line: 872

      select column_type
        from fnd_columns fcol
            ,fnd_tables ftab
       where ftab.table_name = upper(TabNameIn)
         and ftab.table_id = fcol.table_id
         and fcol.column_name =upper(ColumnNameIn);
Line: 879

      select validation_type,format_type
        from fnd_flex_value_sets
       where flex_value_set_id = p_valuesetIdIn;
Line: 889

     p_select := 'AME_400818_INV_VALIDATION_TYP';
Line: 894

      fnd_flex_val_api.get_independent_vset_select
        (p_value_set_id    => p_value_set_id
        ,x_select          => l_select
        ,x_mapping_code    => l_mapping_code
        ,x_success         => l_success
        );
Line: 900

      l_before_from := substrb(l_select,1,instrb(lower(l_select),'from') - 1);
Line: 901

      l_after_from := substrb(l_select,instrb(lower(l_select),'from')+4);
Line: 904

                                            instrb(lower(l_before_from),'select')+6
                                            )
                                    ),
                                    fnd_global.local_chr(10),
                                    '');
Line: 918

      p_select := 'select '||l_column1||' VALUE, '||l_column2||' MEANING from'||l_after_from;
Line: 932

      p_select := rtrim('select ' ||
                        l_v_r.table_info.value_column_name ||
                        ' Value, ' ||
                        l_column2 ||
                        ' Meaning from ' ||
                        l_v_r.table_info.table_name ||
                        ' ' ||
                        l_whr
                        );
Line: 942

    if(validate_query(p_select) <> 'Y' ) then
      p_select := 'AME_400779_INV_VALUE_SET';
Line: 945

    if(p_select <> 'AME_400779_INV_VALUE_SET' and l_format_type = 'N' and l_validation_type = 'F') then
      open fnd_attr_data_type( TabNameIn     =>l_v_r.table_info.table_name
                              ,ColumnNameIn =>l_v_r.table_info.value_column_name);
Line: 951

        p_select := 'AME_400819_INV_VAL_COL_TYPE';
Line: 957

      p_select := 'AME_400779_INV_VALUE_SET';
Line: 960

  function get_rule_last_update_date
    (p_rule_id integer
    ,p_application_id integer
    ,p_usage_start_date date
    ) return date is

  cursor c_last_update_date (c_rule_id integer,c_application_id integer,c_rule_usage_start_date date) is
    select ar.last_update_date RULE_LUD,
           ar.last_updated_by RULE_LUB,
           null RULE_USAGE_LUD,
           null RULE_USAGE_LUB,
           null RULE_USAGE_ED,
           null CONDITION_USAGE_LUD,
           null CONDITION_USAGE_LUB,
           null ACTION_USAGE_LUD,
           null ACTION_USAGE_LUB
      from ame_rules ar
     where ar.rule_id = c_rule_id
       and ar.last_update_date in (select max(last_update_date)
                                     from ame_rules art
                                    where art.rule_id = c_rule_id)
       and rownum < 2
    union
    select null RULE_LUD,
           null RULE_LUB,
           aru.last_update_date RULE_USAGE_LUD,
           aru.last_updated_by RULE_USAGE_LUB,
           aru.end_date RULE_USAGE_ED,
           null CONDITION_USAGE_LUD,
           null CONDITION_USAGE_LUB,
           null ACTION_USAGE_LUD,
           null ACTION_USAGE_LUB
      from ame_rule_usages aru
     where aru.rule_id = c_rule_id
       and aru.item_id = c_application_id
       and aru.start_date = c_rule_usage_start_date
       and aru.start_date < aru.end_date
       and aru.last_update_date in (select max(last_update_date)
                                      from ame_rule_usages arut
                                     where arut.rule_id = c_rule_id
                                       and arut.item_id = c_application_id
                                       and arut.start_date = c_rule_usage_start_date
                                       and arut.start_date < arut.end_date)
       and rownum < 2
    union
    select null RULE_LUD,
           null RULE_LUB,
           null RULE_USAGE_LUD,
           null RULE_USAGE_LUB,
           null RULE_USAGE_ED,
           acu.last_update_date CONDITION_USAGE_LUD,
           acu.last_updated_by CONDITION_USAGE_LUB,
           null ACTION_USAGE_LUD,
           null ACTION_USAGE_LUB
      from ame_condition_usages acu
     where acu.rule_id = c_rule_id
       and acu.last_update_date in (select max(last_update_date)
                                      from ame_condition_usages acut
                                     where acut.rule_id = c_rule_id)
       and rownum < 2
    union
    select null RULE_LUD,
           null RULE_LUB,
           null RULE_USAGE_LUD,
           null RULE_USAGE_LUB,
           null RULE_USAGE_ED,
           null CONDITION_USAGE_LUD,
           null CONDITION_USAGE_LUB,
           aau.last_update_date ACTION_USAGE_LUD,
           aau.last_updated_by ACTION_USAGE_LUB
      from ame_action_usages aau
     where aau.rule_id = c_rule_id
       and aau.last_update_date in (select max(last_update_date)
                                      from ame_action_usages aaut
                                     where aaut.rule_id = c_rule_id)
       and rownum < 2;
Line: 1057

    latest_update_date date;
Line: 1058

    latest_update_by integer;
Line: 1062

    open c_last_update_date(p_rule_id,p_application_id,p_usage_start_date);
Line: 1064

      fetch c_last_update_date into rl_lud,
                                    rl_lub,
                                    ru_lud,
                                    ru_lub,
                                    ru_ed,
                                    cu_lud,
                                    cu_lub,
                                    au_lud,
                                    au_lub;
Line: 1073

      exit when c_last_update_date%notfound;
Line: 1089

    close c_last_update_date;
Line: 1091

    latest_update_date := rule_lud;
Line: 1092

    latest_update_by := rule_lub;
Line: 1094

    if condition_usage_lud > latest_update_date then
      latest_update_date := condition_usage_lud;
Line: 1096

      latest_update_by := condition_usage_lub;
Line: 1099

    if action_usage_lud > latest_update_date then
      latest_update_date := action_usage_lud;
Line: 1101

      latest_update_by := action_usage_lub;
Line: 1104

    if rule_usage_lud > latest_update_date then
      latest_update_date := rule_usage_lud;
Line: 1106

      latest_update_by := rule_usage_lub;
Line: 1109

    if rule_usage_ed < latest_update_date then
      latest_update_date := rule_usage_ed;
Line: 1111

      latest_update_by := rule_usage_lub;
Line: 1114

    return latest_update_date;
Line: 1115

  end get_rule_last_update_date;
Line: 1117

  function get_rule_last_updated_by
    (p_rule_id integer
    ,p_application_id integer
    ,p_usage_start_date date
    ) return integer is

  cursor c_last_update_date (c_rule_id integer,c_application_id integer,c_rule_usage_start_date date) is
    select ar.last_update_date RULE_LUD,
           ar.last_updated_by RULE_LUB,
           null RULE_USAGE_LUD,
           null RULE_USAGE_LUB,
           null RULE_USAGE_ED,
           null CONDITION_USAGE_LUD,
           null CONDITION_USAGE_LUB,
           null ACTION_USAGE_LUD,
           null ACTION_USAGE_LUB
      from ame_rules ar
     where ar.rule_id = c_rule_id
       and ar.last_update_date in (select max(last_update_date)
                                     from ame_rules art
                                    where art.rule_id = c_rule_id)
       and rownum < 2
    union
    select null RULE_LUD,
           null RULE_LUB,
           aru.last_update_date RULE_USAGE_LUD,
           aru.last_updated_by RULE_USAGE_LUB,
           aru.end_date RULE_USAGE_ED,
           null CONDITION_USAGE_LUD,
           null CONDITION_USAGE_LUB,
           null ACTION_USAGE_LUD,
           null ACTION_USAGE_LUB
      from ame_rule_usages aru
     where aru.rule_id = c_rule_id
       and aru.item_id = c_application_id
       and aru.start_date = c_rule_usage_start_date
       and aru.start_date < aru.end_date
       and aru.last_update_date in (select max(last_update_date)
                                      from ame_rule_usages arut
                                     where arut.rule_id = c_rule_id
                                       and arut.item_id = c_application_id
                                       and arut.start_date = c_rule_usage_start_date
                                       and arut.start_date < arut.end_date)
       and rownum < 2
    union
    select null RULE_LUD,
           null RULE_LUB,
           null RULE_USAGE_LUD,
           null RULE_USAGE_LUB,
           null RULE_USAGE_ED,
           acu.last_update_date CONDITION_USAGE_LUD,
           acu.last_updated_by CONDITION_USAGE_LUB,
           null ACTION_USAGE_LUD,
           null ACTION_USAGE_LUB
      from ame_condition_usages acu
     where acu.rule_id = c_rule_id
       and acu.last_update_date in (select max(last_update_date)
                                      from ame_condition_usages acut
                                     where acut.rule_id = c_rule_id)
       and rownum < 2
    union
    select null RULE_LUD,
           null RULE_LUB,
           null RULE_USAGE_LUD,
           null RULE_USAGE_LUB,
           null RULE_USAGE_ED,
           null CONDITION_USAGE_LUD,
           null CONDITION_USAGE_LUB,
           aau.last_update_date ACTION_USAGE_LUD,
           aau.last_updated_by ACTION_USAGE_LUB
      from ame_action_usages aau
     where aau.rule_id = c_rule_id
       and aau.last_update_date in (select max(last_update_date)
                                      from ame_action_usages aaut
                                     where aaut.rule_id = c_rule_id)
       and rownum < 2;
Line: 1214

    latest_update_date date;
Line: 1215

    latest_update_by integer;
Line: 1219

    open c_last_update_date(p_rule_id,p_application_id,p_usage_start_date);
Line: 1221

      fetch c_last_update_date into rl_lud,
                                    rl_lub,
                                    ru_lud,
                                    ru_lub,
                                    ru_ed,
                                    cu_lud,
                                    cu_lub,
                                    au_lud,
                                    au_lub;
Line: 1230

      exit when c_last_update_date%notfound;
Line: 1246

    close c_last_update_date;
Line: 1248

    latest_update_date := rule_lud;
Line: 1249

    latest_update_by := rule_lub;
Line: 1251

    if condition_usage_lud > latest_update_date then
      latest_update_date := condition_usage_lud;
Line: 1253

      latest_update_by := condition_usage_lub;
Line: 1256

    if action_usage_lud > latest_update_date then
      latest_update_date := action_usage_lud;
Line: 1258

      latest_update_by := action_usage_lub;
Line: 1261

    if rule_usage_lud > latest_update_date then
      latest_update_date := rule_usage_lud;
Line: 1263

      latest_update_by := rule_usage_lub;
Line: 1266

    if rule_usage_ed < latest_update_date then
      latest_update_date := rule_usage_ed;
Line: 1268

      latest_update_by := rule_usage_lub;
Line: 1271

    return latest_update_by;
Line: 1272

  end get_rule_last_updated_by;
Line: 1281

      select rule_id
        from ame_rules
       where rule_id = ruleId
         and (sysdate between start_date and nvl(end_date - (1/86400),sysdate) or
                  (start_date > sysdate and start_date < nvl(end_date,start_date + (1/86400)))
                 );
Line: 1289

      select count(rule_id)
        from ame_rule_usages
       where rule_id = ruleId
         and item_id = applicationId
         and start_date = usageStartDate
         and start_date < end_date
         and (sysdate between start_date and nvl(end_date - (1/86400),sysdate) or
              (start_date > sysdate and start_date < nvl(end_date,start_date + (1/86400)))
             );
Line: 1308

      return 'UpdateDisabled';
Line: 1316

      return 'UpdateDisabled';
Line: 1318

      return 'UpdateEnabled';
Line: 1323

  function get_rule_last_update_action
    (p_rule_id integer
    ,p_application_id integer
    ,p_usage_start_date date
    ,p_usage_end_date date
    ) return varchar2 is

  cursor c_row_count (c_rule_id integer,c_application_id integer,c_rule_usage_start_date date) is
   select count(ar.rule_id) RULE_COUNT,
          null CONDITION_USAGE_COUNT,
          null ACTION_USAGE_COUNT
     from ame_rules ar
    where ar.rule_id = c_rule_id
      and ar.last_update_date > (c_rule_usage_start_date + (1/86400))
   union
   select null RULE_COUNT,
          count(acu.rule_id) CONDITION_USAGE_COUNT,
          null ACTION_USAGE_COUNT
     from ame_condition_usages acu
    where acu.rule_id = c_rule_id
      and acu.last_update_date > (c_rule_usage_start_date + (1/86400))
   union
   select null RULE_COUNT,
          null CONDITION_USAGE_COUNT,
          count(aau.rule_id) ACTION_USAGE_COUNT
     from ame_action_usages aau
    where aau.rule_id = c_rule_id
      and aau.last_update_date > (c_rule_usage_start_date + (1/86400));
Line: 1375

      latest_action := 'DELETED';
Line: 1379

      latest_action := 'UPDATED';
Line: 1384

  end get_rule_last_update_action;
Line: 1397

      select count(*)
        from ame_attribute_usages
        where attribute_id = attributeIdIn
          and application_id = applicationIdIn
          and sysdate between start_date
                      and nvl(end_date - (1/86400), sysdate);
Line: 1419

    select count(*)
      into temp_count
      from ame_item_class_usages itu,
          ame_attributes atr
     where itu.item_class_id = atr.item_class_id
       and itu.application_id = l_application_id
       and atr.attribute_id = l_attribute_id
       and sysdate between itu.start_date
                   and nvl(itu.end_date - (1/86400), sysdate)
       and sysdate between atr.start_date
                   and nvl(atr.end_date - (1/86400), sysdate);
Line: 1441

    select atr.approver_type_id
      into temp_count
      from ame_attributes atr
     where atr.attribute_id = l_attribute_id
       and sysdate between atr.start_date
                   and nvl(atr.end_date - (1/86400), sysdate);
Line: 1453

    select count(*) into temp_count
      from ame_attributes atr,
           ame_approver_types apt
     where atr.approver_type_id = apt.approver_type_id
       and atr.attribute_id = l_attribute_id
       and sysdate between atr.start_date
                   and nvl(atr.end_date - (1/86400), sysdate)
       and sysdate between apt.start_date
                   and nvl(apt.end_date - (1/86400), sysdate)
       and apt.orig_system in ('FND_USR','PER');
Line: 1483

      select max(ar.end_date)
        into l_rule_end_date
        from ame_rules ar
       where rule_id = p_rule_id;
Line: 1508

      select min(rule_id) - 1
        into l_rule_id
        from ame_rules;
Line: 1512

      select ame_rules_s.nextval
        into l_rule_id
        from sys.dual;
Line: 1523

      select min(condition_id) - 1
        into l_condition_id
        from ame_conditions;
Line: 1527

      select ame_conditions_s.nextval
        into l_condition_id
        from sys.dual;
Line: 1537

    select max(item_class_id) + 1
      into l_item_class_id
      from ame_item_classes;
Line: 1559

      select ame_approver_types_s.nextval into nextSequence from dual;
Line: 1560

      select count(*)
        into countOfIds
          from ame_approver_types
            where approver_type_id = nextSequence;