DBA Data[Home] [Help]

APPS.AME_APPROVAL_GROUP_PKG SQL Statements

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

Line: 20

    updateDependentGroups updates ame_approval_group_members for the group with
    group ID groupIdIn, and all groups depending on it (explicitly or implicitly).
    If deleteGroupIn is true, updateDependentGroups also removes (end-dates) the
    group with ID groupIdIn from dependent group's item lists.
  */
  procedure updateDependentGroups(groupIdIn in integer,
                                  deleteGroupIn in boolean default false);
Line: 31

      select created_by
        into createdByValue
        from ame_approval_groups
        where
	approval_group_id = approvalGroupIdIn and
           sysdate between start_date and
                 nvl(end_date - ame_util.oneSecond, sysdate) ;
Line: 59

      select nvl(max(order_number), 0)
        into orderNumber
        from ame_approval_group_items
        where
          approval_group_id = approvalGroupIdIn and
          sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate);
Line: 80

      select nvl(max(order_number), 0)
        into orderNumber
        from ame_approval_group_config
        where
          application_id = applicationIdIn and
          sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate) ;
Line: 102

      select order_number
        into orderNumber
        from ame_approval_group_config
        where
          approval_group_id = approvalGroupIdIn and
          application_id = applicationIdIn and
          sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate) ;
Line: 128

      select description
        into description
        from ame_approval_groups
        where
          approval_group_id = approvalGroupIdIn and
          sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate) ;
Line: 153

      select approval_group_id
        into approvalGroupId
        from ame_approval_groups
        where
          upper(name) = upper(nameIn) and
          sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate) ;
Line: 178

      select approval_group_id
        into approvalGroupId
        from ame_approval_group_items
        where
          approval_group_item_id = approvalGroupItemIdIn and
          sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate) ;
Line: 205

      select approval_group_item_id
        into itemId
        from ame_approval_group_items
        where
          upper(parameter) = upper(parameterIn) and
          (upper(parameter_name) = upper(parameterNameIn)) and
          sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate) ;
Line: 231

      select parameter
        into parameter
        from ame_approval_group_items
        where
          approval_group_item_id = approvalGroupItemIdIn and
          sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate) ;
Line: 256

      select parameter_name
        into parameterName
        from ame_approval_group_items
        where
          approval_group_item_id = approvalGroupItemIdIn and
          sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate);
Line: 282

      if(approvalGroupIdIn = ame_util.nullInsertionGroupOrChainId) then
        return('''no approval group'' and ''no chain of authority''');
Line: 285

      select name
        into name
        from ame_approval_groups
        where
          approval_group_id = approvalGroupIdIn and
          nvl(effectiveDateIn, sysdate) between start_date and
                    nvl(end_date - ame_util.oneSecond, sysdate) ;
Line: 313

      select query_string
        into queryString
        from ame_approval_groups
        where
          approval_group_id = approvalGroupIdIn and
          nvl(effectiveDateIn, sysdate) between start_date and
                  nvl(end_date - ame_util.oneSecond, sysdate) ;
Line: 355

      select is_static
        into isStatic
        from ame_approval_groups
        where approval_group_id = approvalGroupIdIn and
        sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate) ;
Line: 381

      select start_date
        into startDate
        from ame_approval_group_config
        where
          approval_group_id = approvalGroupIdIn and
          application_id = applicationIdIn and
          sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate) ;
Line: 409

      select start_date
        into startDate
        from ame_approval_groups
        where
          approval_group_id = approvalGroupIdIn and
          sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate) ;
Line: 435

      select order_number
        into orderNumber
        from ame_approval_group_items
        where
           approval_group_item_id = approvalGroupItemIdIn and
           sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate) ;
Line: 461

      select count(*)
        into orderCount
        from ame_approval_group_items
        where
          approval_group_id = approvalGroupIdIn and
          sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate);
Line: 469

         within the select list. */
      if(newGroupMemberIn) then
        return(orderCount + 1);
Line: 493

      select voting_regime
        into votingRegime
        from ame_approval_group_config
        where
           approval_group_id = approvalGroupIdIn and
           application_id = applicationIdIn and
           sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate) ;
Line: 515

      select
        parameter,
        parameter_name
        from ame_approval_group_items
        where
          approval_group_id = approvalGroupIdIn and
          sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate) ;
Line: 559

      select count(*)
        into tempCount
        from ame_approval_groups
       where ame_approval_groups.approval_group_id = approvalGroupIdIn
         and (nameIn is null or upper(name) = upper(nameIn))
         and (descriptionIn is null or upper(description) = upper(descriptionIn))
         and is_static = isStaticIn
         and (queryStringIn is null or upper(query_string) = upper(queryStringIn))
         and sysdate between ame_approval_groups.start_date
         and nvl(ame_approval_groups.end_date - ame_util.oneSecond, sysdate);
Line: 594

    groupHasBeenUpdated boolean;
Line: 602

         then group has been updated. */
      if(not oldOrderNumberUnique and orderNumberUniqueIn = ame_util.yes) then
        groupHasBeenUpdated := true;
Line: 606

        groupHasBeenUpdated := false;
Line: 608

      select count(*)
        into tempCount
        from
          ame_approval_groups,
          ame_approval_group_config
        where
          ame_approval_groups.approval_group_id = ame_approval_group_config.approval_group_id and
          ame_approval_groups.approval_group_id = approvalGroupIdIn and
          ame_approval_group_config.application_id = applicationIdIn and
          ame_approval_group_config.voting_regime = votingRegimeIn and
          ame_approval_group_config.order_number = orderNumberIn and
          (nameIn is null or upper(name) = upper(nameIn)) and
          (descriptionIn is null or upper(description) = upper(descriptionIn)) and
          is_static = isStaticIn and
          (queryStringIn is null or upper(query_string) = upper(queryStringIn)) and
           sysdate between ame_approval_groups.start_date and
             nvl(ame_approval_groups.end_date - ame_util.oneSecond, sysdate) and
           sysdate between ame_approval_group_config.start_date and
             nvl(ame_approval_group_config.end_date - ame_util.oneSecond, sysdate);
Line: 627

      if(tempCount = 0 or groupHasBeenUpdated) then
        return(true);
Line: 645

      select count(*)
        into useCount
        from
          ame_actions,
          ame_action_types,
          ame_action_usages
        where
          ame_actions.parameter = to_char(approvalGroupIdIn) and
          ame_action_usages.action_id = ame_actions.action_id and
          ame_actions.action_type_id = ame_action_types.action_type_id and
          ame_action_types.name in (ame_util.preApprovalTypeName,
                                    ame_util.postApprovalTypeName,
                                    ame_util.groupChainApprovalTypeName) and
          sysdate between ame_actions.start_date and
            nvl(ame_actions.end_date - ame_util.oneSecond, sysdate) and
          sysdate between ame_action_types.start_date and
            nvl(ame_action_types.end_date - ame_util.oneSecond, sysdate) and
          ((sysdate between ame_action_usages.start_date and
                nvl(ame_action_usages.end_date - ame_util.oneSecond, sysdate)) or
             (sysdate < ame_action_usages.start_date and
                ame_action_usages.start_date < nvl(ame_action_usages.end_date,
                              ame_action_usages.start_date + ame_util.oneSecond)));
Line: 689

      select is_static
        into isStatic
        from ame_approval_groups
        where approval_group_id = approvalGroupIdIn and
        nvl(effectiveDateIn, sysdate) between start_date and
                      nvl(end_date - ame_util.oneSecond, sysdate);
Line: 718

      select count(*)
        into tempCount
        from ame_approval_group_items
        where
          approval_group_id = approvalGroupIdIn and
          order_number = orderNumberIn and
          sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate);
Line: 748

               updateActionIn in boolean default false) return integer as
    approvalGroupId integer;
Line: 770

        select approval_group_id
          into approvalGroupId
          from ame_approval_groups
          where
            (approvalGroupIdIn is null or approval_group_id <> approvalGroupIdIn) and
            upper(name) = upper(nameIn) and
            sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate);
Line: 805

        select ame_approval_groups_s.nextval into approvalGroupId from dual;
Line: 808

        select count(*)
         into tempCount
         from ame_approval_groups
           where
             approval_group_id = approvalGroupIdIn and
             created_by = ame_util.seededDataCreatedById;
Line: 822

      /* insert into ame_actions proper values for the approval group */
      if(approvalGroupIdIn is null or updateActionIn) then
        for i in 1..3 loop
          if i = 1 then
            actionTypeId := ame_action_pkg.getPreApprovalActionTypeId;
Line: 841

          if(updateActionIn) then
            select action_id into actionId
              from ame_actions
                where
                  parameter = to_char(approvalGroupId) and
                  action_type_id = actionTypeId and
                  sysdate between start_date and
                    nvl(end_date - ame_util.oneSecond, sysdate)
              for update of end_date;
Line: 850

            update ame_actions
              set
                 last_updated_by = currentUserId,
                 last_update_date = processingDate,
                 last_update_login = currentUserId,
                 end_date = processingDate
                where
                  parameter = to_char(approvalGroupId) and
                      action_type_id = actionTypeId and
                  processingDate between start_date and
                      nvl(end_date - ame_util.oneSecond, processingDate) ;
Line: 863

                                                 updateParentObjectIn => true,
                                                 parameterIn => approvalGroupId,
                                                 newStartDateIn => processingDate,
                                                 finalizeIn => true,
                                                 parentVersionStartDateIn => parentVersionStartDate,
                                                 actionIdIn => actionId);
Line: 872

                                                 updateParentObjectIn => true,
                                                 parameterIn => approvalGroupId,
                                                 newStartDateIn => processingDate,
                                                 parentVersionStartDateIn => parentVersionStartDate,
                                                 finalizeIn => true);
Line: 880

      insert into ame_approval_groups(approval_group_id,
                                      name,
                                      created_by,
                                      creation_date,
                                      last_updated_by,
                                      last_update_date,
                                      last_update_login,
                                      start_date,
                                      end_date,
                                      description,
                                      query_string,
                                      is_static)
        values(approvalGroupId,
               nameIn,
               createdBy,
               processingDate,
               currentUserId,
               processingDate,
               currentUserId,
               nvl(newStartDateIn, processingDate),
               null,
               descriptionIn,
               queryStringIn,
               isStaticIn);
Line: 904

      updateDependentGroups(groupIdIn => approvalGroupId);
Line: 978

      select start_date
        from ame_approval_groups
        where
          approval_group_id = approvalGroupIdIn and
          sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate)
        for update;
Line: 1005

    updateOnlyGIModified boolean;
Line: 1015

        select count(*)
          into tempCount
          from ame_approval_group_items
          where
            (approvalGroupItemIdIn is null or approval_group_item_id <> approvalGroupItemIdIn) and
            approval_group_id = approvalGroupIdIn and
            upper(parameter) = upper(parameterIn) and
            (upper(parameter_name) = upper(parameterNameIn)) and
            sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate) ;
Line: 1043

            select ame_approval_group_items_s.nextval into approvalGroupItemId from dual;
Line: 1046

            select count(*)
              into tempCount2
              from ame_approval_group_items
                where
                  approval_group_item_id = approvalGroupItemId and
                  created_by = ame_util.seededDataCreatedById;
Line: 1064

          updateOnlyGIModified := false;
Line: 1069

                updateOnlyGIModified := true; /* Order number not modified. */
Line: 1079

              update ame_approval_group_items
                set
                  last_updated_by = currentUserId,
                  last_update_date = newEndDateIn,
                  last_update_login = currentUserId,
                  end_date = newEndDateIn
                where
                  approval_group_item_id = approvalGroupItemIdIn and
                  sysdate between start_date and
                    nvl(end_date - ame_util.oneSecond, sysdate);
Line: 1119

              insert into ame_approval_group_items(approval_group_item_id,
                                                   approval_group_id,
                                                   parameter_name,
                                                   parameter,
                                                   order_number,
                                                   created_by,
                                                   creation_date,
                                                   last_updated_by,
                                                   last_update_date,
                                                   last_update_login,
                                                   start_date,
                                                   end_date)
                values(approvalGroupItemId,
                       approvalGroupIdIn,
                       parameterNameIn,
                       parameterIn,
                       newOrderNumber,
                       createdBy,
                       newStartDateIn,
                       currentUserId,
                       newStartDateIn,
                       currentUserId,
                       newStartDateIn,
                       null);
Line: 1145

            updateOnlyGIModified := true;
Line: 1147

          if(updateOnlyGIModified) then
            if(approvalGroupItemIdIn is not null) then
              update ame_approval_group_items
                set
                  last_updated_by = currentUserId,
                  last_update_date = newEndDateIn,
                  last_update_login = currentUserId,
                  end_date = newEndDateIn
                where
                  approval_group_item_id = approvalGroupItemIdIn and
                  sysdate between start_date and
                    nvl(end_date - ame_util.oneSecond, sysdate);
Line: 1174

						insert into ame_approval_group_items(approval_group_item_id,
                                                 approval_group_id,
                                                 parameter_name,
                                                 parameter,
                                                 order_number,
                                                 created_by,
                                                 creation_date,
                                                 last_updated_by,
                                                 last_update_date,
                                                 last_update_login,
                                                 start_date,
                                                 end_date)
              values(approvalGroupItemId,
                     approvalGroupIdIn,
                     parameterNameIn,
                     parameterIn,
                     newOrderNumberIn,
                     createdBy,
                     nvl(newStartDateIn, processingDate),
                     currentUserId,
                     nvl(newStartDateIn, processingDate),
                     currentUserId,
                     nvl(newStartDateIn, processingDate),
                     null);
Line: 1211

          updateDependentGroups(groupIdIn => approvalGroupIdIn);
Line: 1271

            messageNameIn => 'AME_400145_ACT_OBJECT_DELETED');
Line: 1361

      select count(*)
        into tempCount
        from ame_approval_group_config
        where
          application_id = applicationIdIn and
          order_number = orderNumberIn and
          sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate);
Line: 1389

                   updateActionIn in boolean,
                   newVersionStartDateIn in date,
                   finalizeIn in boolean default false) as
    approvalGroupId integer;
Line: 1403

        update ame_approval_groups
          set
            last_updated_by = currentUserId,
            last_update_date = endDate,
            last_update_login = currentUserId,
            end_date = endDate
          where
            approval_group_id = approvalGroupIdIn and
            sysdate between start_date and
                       nvl(end_date - ame_util.oneSecond, sysdate) ;
Line: 1419

                               updateActionIn => updateActionIn,
                               finalizeIn => false);
Line: 1421

      /* The new function calls updateDependentGroups, so we don't have to do it here. */
      if(finalizeIn) then
        commit;
Line: 1452

      select start_date
        from ame_approval_groups
        where
          approval_group_id = approvalGroupIdIn and
           sysdate between start_date and
                 nvl(end_date - ame_util.oneSecond, sysdate)
        for update;
Line: 1460

      select start_date
        from ame_approval_group_config
        where
          approval_group_id = approvalGroupIdIn and
          application_id = applicationIdIn and
           sysdate between start_date and
                 nvl(end_date - ame_util.oneSecond, sysdate)
        for update;
Line: 1477

    updateAction boolean;
Line: 1498

          /* Get current values as necessary for update. */
          if(nameIn is null) then
            name := getName(approvalGroupIdIn => approvalGroupIdIn);
Line: 1510

           update the ame_actions table. */
          if(nameIn <> getName(approvalGroupIdIn => approvalGroupIdIn)) then
            updateAction := true;
Line: 1514

            updateAction := false;
Line: 1531

                                        updateActionIn => updateAction,
                                        finalizeIn => false);
Line: 1577

          messageNameIn => 'AME_400145_ACT_OBJECT_DELETED');
Line: 1617

    updateOnlyAGModified boolean;
Line: 1630

      updateOnlyAGModified := false;
Line: 1634

          updateOnlyAGModified := true;
Line: 1645

        update ame_approval_group_config
          set
            last_updated_by = currentUserId,
            last_update_date = endDate,
            last_update_login = currentUserId,
            end_date = endDate
          where
            application_id = applicationIdIn and
            approval_group_id = approvalGroupIdIn and
            sysdate between start_date and
              nvl(end_date - ame_util.oneSecond, sysdate);
Line: 1672

        insert into ame_approval_group_config(application_id,
                                              approval_group_id,
                                              voting_regime,
                                              order_number,
                                              created_by,
                                              creation_date,
                                              last_updated_by,
                                              last_update_date,
                                              last_update_login,
                                              start_date,
                                              end_date)
          values(applicationIdIn,
                 approvalGroupIdIn,
                 votingRegimeIn,
                 newOrderNumber,
                 currentUserId,
                 newStartDate,
                 currentUserId,
                 newStartDate,
                 currentUserId,
                 newStartDate,
                 null);
Line: 1695

      if(updateOnlyAGModified) then
        update ame_approval_group_config
          set
            last_updated_by = currentUserId,
            last_update_date = endDate,
            last_update_login = currentUserId,
            end_date = endDate
          where
            application_id = applicationIdIn and
            approval_group_id = approvalGroupIdIn and
            sysdate between start_date and
              nvl(end_date - ame_util.oneSecond, sysdate);
Line: 1707

        insert into ame_approval_group_config(application_id,
                                              approval_group_id,
                                              voting_regime,
                                              order_number,
                                              created_by,
                                              creation_date,
                                              last_updated_by,
                                              last_update_date,
                                              last_update_login,
                                              start_date,
                                              end_date)
          values(applicationIdIn,
                 approvalGroupIdIn,
                 votingRegimeIn,
                 orderNumberIn,
                 currentUserId,
                 newStartDate,
                 currentUserId,
                 newStartDate,
                 currentUserId,
                 newStartDate,
                 null);
Line: 1771

      select start_date
        from ame_approval_groups
        where
          approval_group_id = approvalGroupIdIn and
          sysdate between start_date and
                         nvl(end_date - ame_util.oneSecond, sysdate)
        for update;
Line: 1833

          update ame_approval_groups
            set
              last_updated_by = currentUserId,
              last_update_date = endDate,
              last_update_login = currentUserId,
              end_date = endDate
            where
              approval_group_id = approvalGroupIdIn and
              sysdate between start_date and
                         nvl(end_date - ame_util.oneSecond, sysdate) ;
Line: 1865

            messageNameIn => 'AME_400145_ACT_OBJECT_DELETED');
Line: 1891

      select approval_group_item_id, order_number
        from ame_approval_group_items
        where
          approval_group_id = approvalGroupIdIn and
          order_number > orderNumberIn and
          sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate)
          order by order_number;
Line: 1918

				update ame_approval_group_items
          set
            last_updated_by = currentUserId,
            last_update_date = processingDate,
            last_update_login = currentUserId,
            end_date = processingDate
          where
            approval_group_item_id = approvalGroupItemIds(i) and
            sysdate between start_date and
              nvl(end_date - ame_util.oneSecond, sysdate);
Line: 1928

        insert into ame_approval_group_items(approval_group_item_id,
                                             approval_group_id,
                                             parameter_name,
                                             parameter,
                                             order_number,
                                             created_by,
                                             creation_date,
                                             last_updated_by,
                                             last_update_date,
                                             last_update_login,
                                             start_date,
                                             end_date)
          values(approvalGroupItemIds(i),
                 approvalGroupIdIn,
                 parameterName,
                 parameter,
                 (orderNumbers(i) - 1),
                 currentUserId,
                 processingDate,
                 currentUserId,
                 processingDate,
                 currentUserId,
                 processingDate,
                 null);
Line: 1969

      select approval_group_id, order_number
        from ame_approval_group_config
        where
          application_id = applicationIdIn and
          order_number > orderNumberIn and
          sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate)
          order by order_number;
Line: 1992

        update ame_approval_group_config
          set
            last_updated_by = currentUserId,
            last_update_date = processingDate,
            last_update_login = currentUserId,
            end_date = processingDate
          where
            application_id = applicationIdIn and
            approval_group_id = approvalGroupIds(i) and
            sysdate between start_date and
              nvl(end_date - ame_util.oneSecond, sysdate);
Line: 2003

        insert into ame_approval_group_config(application_id,
                                              approval_group_id,
                                              voting_regime,
                                              order_number,
                                              created_by,
                                              creation_date,
                                              last_updated_by,
                                              last_update_date,
                                              last_update_login,
                                              start_date,
                                              end_date)
          values(applicationIdIn,
                 approvalGroupIds(i),
                 votingRegime,
                 (orderNumbers(i) - 1),
                 currentUserId,
                 processingDate,
                 currentUserId,
                 processingDate,
                 currentUserId,
                 processingDate,
                 null);
Line: 2042

      select
        approval_group_id,
        name
        from ame_approval_groups
        where
          sysdate between start_date and
                         nvl(end_date - ame_util.oneSecond, sysdate) ;
Line: 2090

      select approval_group_item_id
        from ame_approval_group_items
        where
          approval_group_id = approvalGroupIdIn and
          sysdate between start_date and
                         nvl(end_date - ame_util.oneSecond, sysdate)
           order by order_number;
Line: 2153

      select approval_group_id
        from ame_approval_groups
        where
          sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate);
Line: 2178

      select ame_approval_groups.approval_group_id
        from ame_approval_groups,
             ame_approval_group_config
        where
          ame_approval_groups.approval_group_id = ame_approval_group_config.approval_group_id and
          ame_approval_group_config.application_id = applicationIdIn and
          sysdate between ame_approval_groups.start_date and
                         nvl(ame_approval_groups.end_date - ame_util.oneSecond, sysdate) and
          sysdate between ame_approval_group_config.start_date and
                         nvl(ame_approval_group_config.end_date - ame_util.oneSecond, sysdate)
        order by ame_approval_group_config.order_number;
Line: 2210

      select
        parameter,
        parameter_name
        from ame_approval_group_items
        where
          approval_group_id = approvalGroupIdIn and
          sysdate between start_date and
                         nvl(end_date - ame_util.oneSecond, sysdate)
        order by order_number;
Line: 2226

      select
        is_static,
        query_string
        into
          isStatic,
          queryString
        from ame_approval_groups
        where
          approval_group_id = approvalGroupIdIn and
          sysdate between start_date and
                         nvl(end_date - ame_util.oneSecond, sysdate) ;
Line: 2258

        memberTypesOut.delete;
Line: 2259

        memberIdsOut.delete;
Line: 2280

      select approval_group_item_id, parameter
        from ame_approval_group_items
        where
          approval_group_id = approvalGroupIdIn and
          parameter_name <> ame_util.approverOamGroupId and
          sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate)
           order by order_number;
Line: 2323

      select
        parameter,
        parameter_name,
        order_number
        from ame_approval_group_items
        where
          approval_group_id = approvalGroupIdIn and
          effectiveDateIn between start_date and nvl(end_date - ame_util.oneSecond, sysdate)
        order by order_number;
Line: 2356

            recursionParameterNames.delete;
Line: 2357

            recursionParameters.delete;
Line: 2358

            recursionOrderNumbers.delete;
Line: 2359

            recursionQueries.delete;
Line: 2412

      select order_number
        from ame_approval_group_items
        where approval_group_id = approvalGroupIdIn and
              sysdate between start_date and
                         nvl(end_date - ame_util.oneSecond, sysdate)
        order by order_number;
Line: 2447

      select approval_group_Item_id, order_number
        from ame_approval_group_items
        where
          approval_group_id = approvalGroupIdIn and
          approval_group_item_id <> approvalGroupItemIdIn and
          order_number >= orderNumberIn and
          sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate)
          order by order_number;
Line: 2474

        update ame_approval_group_items
          set
            last_updated_by = currentUserId,
            last_update_date = processingDate,
            last_update_login = currentUserId,
            end_date = processingDate
          where
            approval_group_item_id = approvalGroupItemIds(i) and
            sysdate between start_date and
              nvl(end_date - ame_util.oneSecond, sysdate);
Line: 2484

        insert into ame_approval_group_items(approval_group_item_id,
                                             approval_group_id,
                                             parameter_name,
                                             parameter,
                                             order_number,
                                             created_by,
                                             creation_date,
                                             last_updated_by,
                                             last_update_date,
                                             last_update_login,
                                             start_date,
                                             end_date)
          values(approvalGroupItemIds(i),
                 approvalGroupIdIn,
                 parameterName,
                 parameter,
                 (orderNumbers(i) + 1),
                 currentUserId,
                 processingDate,
                 currentUserId,
                 processingDate,
                 currentUserId,
                 processingDate,
                 null);
Line: 2526

      select approval_group_id, order_number
        from ame_approval_group_config
        where
          application_id = applicationIdIn and
          approval_group_id <> approvalGroupIdIn and
          order_number >= orderNumberIn and
          sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate)
          order by order_number;
Line: 2550

        update ame_approval_group_config
          set
            last_updated_by = currentUserId,
            last_update_date = processingDate,
            last_update_login = currentUserId,
            end_date = processingDate
          where
            application_id = applicationIdIn and
            approval_group_id = approvalGroupIds(i) and
            sysdate between start_date and
              nvl(end_date - ame_util.oneSecond, sysdate);
Line: 2561

        insert into ame_approval_group_config(application_id,
                                              approval_group_id,
                                              voting_regime,
                                              order_number,
                                              created_by,
                                              creation_date,
                                              last_updated_by,
                                              last_update_date,
                                              last_update_login,
                                              start_date,
                                              end_date)
          values(applicationIdIn,
                 approvalGroupIds(i),
                 votingRegime,
                 (orderNumbers(i) + 1),
                 currentUserId,
                 processingDate,
                 currentUserId,
                 processingDate,
                 currentUserId,
                 processingDate,
                 null);
Line: 2603

      select application_id
        from ame_calling_apps
        where
          sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate)
      order by application_id;
Line: 2632

          select count(*)
            into tempCount
            from ame_approval_group_config
            where
              application_id = applicationIds(i) and
              sysdate between start_date and
                nvl(end_date - ame_util.oneSecond, sysdate);
Line: 2642

            select (nvl(max(order_number), 0) + 1)
              into orderNumber
              from ame_approval_group_config
              where
                application_id = applicationIds(i) and
                sysdate between start_date and
                  nvl(end_date - ame_util.oneSecond, sysdate);
Line: 2651

        insert into ame_approval_group_config(application_id,
                                              approval_group_id,
                                              voting_regime,
                                              order_number,
                                              created_by,
                                              creation_date,
                                              last_updated_by,
                                              last_update_date,
                                              last_update_login,
                                              start_date,
                                              end_date)
          values(applicationId,
                 approvalGroupIdIn,
                 votingRegimeIn,
                 orderNumber,
                 currentUserId,
                 processingDate,
                 currentUserId,
                 processingDate,
                 currentUserId,
                 processingDate,
                 null);
Line: 2695

      select start_date
        from ame_approval_groups
        where
          approval_group_id = approvalGroupIdIn and
          sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate)
        for update;
Line: 2703

      select application_id
        from ame_calling_apps
        where
          sysdate between start_date and
            nvl(end_date - ame_util.oneSecond, sysdate)
        order by application_id;
Line: 2735

            select order_number
              into orderNumber
              from ame_approval_group_config
              where
                application_id = applicationIds(i) and
                approval_group_id = approvalGroupIdIn and
                sysdate between start_date and
                  nvl(end_date - ame_util.oneSecond, sysdate);
Line: 2745

              /* subtract 1 from the order number for those above the one being deleted */
              decrementGroupOrderNumbers(applicationIdIn => applicationIds(i),
                                         orderNumberIn => orderNumber,
                                         finalizeIn => false);
Line: 2752

          update ame_approval_groups
            set
              last_updated_by = currentUserId,
              last_update_date = processingDate,
              last_update_login = currentUserId,
              end_date = processingDate
            where
              approval_group_id = approvalGroupIdIn and
              processingDate between start_date and
              nvl(end_date - ame_util.oneSecond, processingDate) ;
Line: 2763

          update ame_approval_group_items
            set
              last_updated_by = currentUserId,
              last_update_date = processingDate,
              last_update_login = currentUserId,
              end_date = processingDate
            where
              approval_group_id = approvalGroupIdIn and
              processingDate between start_date and
                         nvl(end_date - ame_util.oneSecond, processingDate);
Line: 2774

          update ame_approval_group_config
            set
              last_updated_by = currentUserId,
              last_update_date = processingDate,
              last_update_login = currentUserId,
              end_date = processingDate
            where
              approval_group_id = approvalGroupIdIn and
              processingDate between start_date and
                nvl(end_date - ame_util.oneSecond, processingDate) ;
Line: 2785

          update ame_actions
            set
              last_updated_by = currentUserId,
              last_update_date = processingDate,
              last_update_login = currentUserId,
              end_date = processingDate
            where
              parameter = to_char(approvalGroupIdIn) and
              processingDate between start_date and
                         nvl(end_date - ame_util.oneSecond, processingDate) ;
Line: 2797

          update those groups in ame_approval_group_members.
          */
          updateDependentGroups(groupIdIn => approvalGroupIdIn,
                                deleteGroupIn => true);
Line: 2831

            messageNameIn => 'AME_400145_ACT_OBJECT_DELETED');
Line: 2869

      select start_date
        from ame_approval_groups
        where
          approval_group_id = approvalGroupIdIn and
          sysdate between start_date and
                         nvl(end_date - ame_util.oneSecond, sysdate)
        for update;
Line: 2877

     select order_number, approval_group_item_id
        from ame_approval_group_items
        where approval_group_id = approvalGroupIdIn and
        sysdate between start_date and
                         nvl(end_date - ame_util.oneSecond, sysdate)
        for update of order_number
        order by order_number;
Line: 2921

              /* subtract 1 from the order number for those above the one being deleted */
             decrementGroupItemOrderNumbers(approvalGroupIdIn => approvalGroupIdIn,
                                            orderNumberIn => itemOrderNumber,
                                            finalizeIn => false);
Line: 2926

           update ame_approval_group_items
             set
               last_updated_by = currentUserId,
               last_update_date = processingDate,
               last_update_login = currentUserId,
               end_date = processingDate
             where
               approval_group_item_id = approvalGroupItemList(i) and
               processingDate between start_date and
                 nvl(end_date - ame_util.oneSecond, processingDate);
Line: 2941

         update ame_approval_groups
           set
             last_updated_by = currentUserId,
             last_update_date = processingDate,
             last_update_login = currentUserId,
             end_date = processingDate
           where
             approval_group_id = approvalGroupIdIn and
             processingDate between start_date and
                         nvl(end_date - ame_util.oneSecond, processingDate);
Line: 2957

         /* new calls updateDependentGroups, so don't do it here. */
         commit;
Line: 2987

           messageNameIn => 'AME_400145_ACT_OBJECT_DELETED');
Line: 3023

      delete from ame_approval_group_members
        where approval_group_id = groupIdIn;
Line: 3033

      /* Only insert members that aren't already there. */
      memberIndex := 0;
Line: 3036

        select count(*)
          into tempCount
          from ame_approval_group_members
          where
            approval_group_id = groupIdIn and
            parameter_name = parameterNames(i) and
            parameter = parameters(i);
Line: 3073

          insert into ame_approval_group_members(
            approval_group_id,
            parameter_name,
            parameter,
            orig_system,
            orig_system_id,
            query_string,
            order_number,
	    approval_group_members_id)
            values(
              groupIdIn,
              parameterNames(i),
              parameters(i),
              origSystem,
              origSystemId,
              queryStrings(i),
              orderNumbers(i),
	      ame_approval_group_members_s.nextval);
Line: 3115

  procedure updateDependentGroups(groupIdIn in integer,
                                  deleteGroupIn in boolean default false) as
    cursor dependentGroupCursor(groupIdIn in integer) is
      select distinct approval_group_id
      from ame_approval_group_items
      where
        parameter_name = ame_util.approverOamGroupId and
        parameter = to_char(groupIdIn) and
        sysdate between start_date and
                         nvl(end_date - ame_util.oneSecond, sysdate) ;
Line: 3125

    groupsToUpdate ame_util.idList;
Line: 3131

        The following loop treats groupsToUpdate as a first-in, first-out queue.
        We enter the loop with the group identified by groupIdIn as the first
        (and so far only) group in the queue.  The loop updates the next group
        in the queue and adds all of the groups that contain it to the end of
        the queue.  In this fashion all of a given group's dependents are updated
        before any of their dependents are updated, etc.
      */
      processingDate := sysdate;
Line: 3139

      groupsToUpdate(1) := groupIdIn;
Line: 3143

        if(deleteGroupIn and currentGroup > 1) then
          /*
            Delete the target group (groupIdIn) from the item list of the current group.
            (Don't do it for currentGroup = 1 because the group is never a member of itself.)
            The call to setGroupMembers below updates ame_approval_group_members for dependent
            groups.
          */
          update ame_approval_group_items
            set end_date = processingDate
            where
              approval_group_id = groupsToUpdate(currentGroup) and
              parameter_name = ame_util.approverOamGroupId and
              parameter = to_char(groupIdIn) and
              processingDate between start_date and
                       nvl(end_date - ame_util.oneSecond, processingDate) ;
Line: 3160

           not deleteGroupIn) then
          setGroupMembers(groupIdIn => groupsToUpdate(currentGroup));
Line: 3163

        for tempGroup in dependentGroupCursor(groupIdIn => groupsToUpdate(currentGroup)) loop
          upperLimit := upperLimit + 1;
Line: 3165

          groupsToUpdate(upperLimit) := tempGroup.approval_group_id;
Line: 3176

                                   routineNameIn => 'updateDependentGroups',
                                   exceptionNumberIn => sqlcode,
                                   exceptionStringIn => ame_util.getMessage(applicationShortNameIn => 'PER',
                                     messageNameIn => 'AME_400354_APPR_GRP_NAME_ERR',
                                     tokenNameOneIn => 'NAME',
                                     tokenValueOneIn => getName(approvalGroupIdIn => groupIdIn))
                                     || ' ' || sqlerrm);
Line: 3184

    end updateDependentGroups;