DBA Data[Home] [Help]

APPS.WF_ENGINE_BULK SQL Statements

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

Line: 46

           user_keys.delete(user_keys.last);
Line: 51

           owner_roles.delete(owner_roles.last);
Line: 53

            itemkeys.delete(itemkeys.last);
Line: 73

    select sys_context('USERENV','CURRENT_SCHEMA')
      into wf_engine_bulk.schema
      from sys.dual;
Line: 125

    insert into WF_ITEMS (
      ITEM_TYPE,
      ITEM_KEY,
      ROOT_ACTIVITY,
      ROOT_ACTIVITY_VERSION,
      OWNER_ROLE,
      PARENT_ITEM_TYPE,
      PARENT_ITEM_KEY,
      PARENT_CONTEXT,
      BEGIN_DATE,
      END_DATE,
      USER_KEY
    ) values (
      itemtype,
      itemkeys(arrInd),
      wflow,
      rootversion,
      owner_roles(arrInd),
      parent_itemtype,
      parent_itemkey,
      parent_context,
      actdate,
      to_date(NULL),
      user_keys(arrInd)
    );
Line: 152

     insert into WF_ITEMS (
      ITEM_TYPE,
      ITEM_KEY,
      ROOT_ACTIVITY,
      ROOT_ACTIVITY_VERSION,
      PARENT_ITEM_TYPE,
      PARENT_ITEM_KEY,
      PARENT_CONTEXT,
      BEGIN_DATE,
      END_DATE,
      USER_KEY
    ) values (
      itemtype,
      itemkeys(arrInd),
      wflow,
      rootversion,
      parent_itemtype,
      parent_itemkey,
      parent_context,
      actdate,
      to_date(NULL),
      user_keys(arrInd)
    );
Line: 177

     insert into WF_ITEMS (
      ITEM_TYPE,
      ITEM_KEY,
      ROOT_ACTIVITY,
      ROOT_ACTIVITY_VERSION,
      OWNER_ROLE,
      PARENT_ITEM_TYPE,
      PARENT_ITEM_KEY,
      PARENT_CONTEXT,
      BEGIN_DATE,
      END_DATE
    ) values (
      itemtype,
      itemkeys(arrInd),
      wflow,
      rootversion,
      owner_roles(arrInd),
      parent_itemtype,
      parent_itemkey,
      parent_context,
      actdate,
      to_date(NULL)
    );
Line: 202

     insert into WF_ITEMS (
      ITEM_TYPE,
      ITEM_KEY,
      ROOT_ACTIVITY,
      ROOT_ACTIVITY_VERSION,
      PARENT_ITEM_TYPE,
      PARENT_ITEM_KEY,
      PARENT_CONTEXT,
      BEGIN_DATE,
      END_DATE
    ) values (
      itemtype,
      itemkeys(arrInd),
      wflow,
      rootversion,
      parent_itemtype,
      parent_itemkey,
      parent_context,
      actdate,
      to_date(NULL)
    );
Line: 232

           itemkeys.DELETE(SQL%BULK_EXCEPTIONS(ExceptionInd).ERROR_INDEX);
Line: 234

            user_keys.DELETE(SQL%BULK_EXCEPTIONS(ExceptionInd).ERROR_INDEX);
Line: 237

            owner_roles.DELETE(SQL%BULK_EXCEPTIONS(ExceptionInd).ERROR_INDEX);
Line: 253

    insert into WF_ITEM_ATTRIBUTE_VALUES (
      ITEM_TYPE,
      ITEM_KEY,
      NAME,
      TEXT_VALUE,
      NUMBER_VALUE,
      DATE_VALUE
    ) select
      itemtype,
      itemkeys(arrInd),
      WIA.NAME,
      WIA.TEXT_DEFAULT,
      WIA.NUMBER_DEFAULT,
      WIA.DATE_DEFAULT
    from WF_ITEM_ATTRIBUTES WIA
    where WIA.ITEM_TYPE = itemtype;
Line: 276

           itemkeys.DELETE(SQL%BULK_EXCEPTIONS(ExceptionInd).ERROR_INDEX);
Line: 277

           user_keys.DELETE(SQL%BULK_EXCEPTIONS(ExceptionInd).ERROR_INDEX);
Line: 278

           owner_roles.DELETE(SQL%BULK_EXCEPTIONS(ExceptionInd).ERROR_INDEX);
Line: 330

    insert into WF_ITEM_ATTRIBUTE_VALUES (
      ITEM_TYPE,
      ITEM_KEY,
      NAME,
      TEXT_VALUE
    ) values (
      itemtype,
      l_itemkeys(arrInd),
      aname,
      BulkAddItemAttr.text_values(arrInd)
    );
Line: 351

         l_itemkeys.DELETE(SQL%BULK_EXCEPTIONS(failIndex).ERROR_INDEX);
Line: 390

  succAttrUpdates Wf_Engine.NameTabTyp;
Line: 391

  succItemUpdates Wf_Engine_Bulk.ItemKeyTabType;
Line: 417

      insert into WF_ITEM_ATTRIBUTE_VALUES
        (ITEM_TYPE, ITEM_KEY, NAME, TEXT_VALUE)
      select itemtype, itemkeys(arrayIndex), anames(arrayIndex), text_default
        from WF_ITEM_ATTRIBUTES WIA
        where
          WIA.ITEM_TYPE = itemtype
        and
          WIA.NAME = anames(arrayIndex)
        and not exists (select 1 from WF_ITEM_ATTRIBUTE_VALUES WIAV
          where WIAV.item_type=itemtype
          and  WIAV.item_key=itemkeys(arrayIndex)
          and  WIAV.NAME=anames(arrayIndex));
Line: 436

  g_FailedItems.DELETE;
Line: 437

  g_FailedAttributes.DELETE;
Line: 441

      update WF_ITEM_ATTRIBUTE_VALUES set
        TEXT_VALUE = avalues(arrInd)
      where ITEM_TYPE = itemtype
      and ITEM_KEY = itemkeys(arrInd)
      and NAME = anames(arrInd)
     returning item_key,name bulk collect into succItemUpdates, succAttrUpdates;
Line: 460

   if (succItemUpdates.count <> itemkeys.COUNT) then
   -- determine the failed item/atrributes
      if succItemUpdates.count=0 then
          g_failedItems:=itemkeys;
Line: 469

         if ((itemkeys.count - i + 1) = succItemUpdates.count) then
          -- we are done, the rest are all successful
          exit;
Line: 474

         j:=succItemUpdates.first;
Line: 475

         while j <= succItemUpdates.last loop
          if anames(i) = succAttrUpdates(j)
             and itemkeys(i) = succItemUpdates(j) then

           -- remove the item/attr from the success table
           succItemUpdates.delete(j);
Line: 481

           succAttrUpdates.delete(j);
Line: 486

          j:=succItemUpdates.next(j);
Line: 497

      end if; --successUpdates count=0
Line: 498

   end if; --sucessUpdates doesnot match item count
Line: 537

  succAttrUpdates Wf_Engine.NameTabTyp;
Line: 538

  succItemUpdates Wf_Engine_Bulk.ItemKeyTabType;
Line: 562

      insert into WF_ITEM_ATTRIBUTE_VALUES
        (ITEM_TYPE, ITEM_KEY, NAME, NUMBER_VALUE)
      select itemtype, itemkeys(arrayIndex), anames(arrayIndex), number_default
        from WF_ITEM_ATTRIBUTES WIA
        where
          WIA.ITEM_TYPE = itemtype
        and
          WIA.NAME = anames(arrayIndex)
        and not exists (select 1 from WF_ITEM_ATTRIBUTE_VALUES WIAV
          where WIAV.item_type=itemtype
          and  WIAV.item_key=itemkeys(arrayIndex)
          and  WIAV.NAME=anames(arrayIndex));
Line: 576

          null; -- ignore failures here and let update to handle the logic
Line: 581

  g_FailedItems.DELETE;
Line: 582

  g_failedAttributes.DELETE;
Line: 587

      update WF_ITEM_ATTRIBUTE_VALUES set
      NUMBER_VALUE = avalues(arrInd)
      where ITEM_TYPE = itemtype
      and ITEM_KEY = itemkeys(arrInd)
      and NAME = anames(arrInd)
     returning item_key,name bulk collect into succItemUpdates, succAttrUpdates;
Line: 606

   if (succItemUpdates.count <> itemkeys.COUNT) then
   -- determine the failed item/atrributes
      if succItemUpdates.count=0 then
          g_failedItems:=itemkeys;
Line: 615

         if ((itemkeys.count - i + 1) = succItemUpdates.count) then
          -- we are done, the rest are all successful
          exit;
Line: 620

         j:=succItemUpdates.first;
Line: 621

         while j <= succItemUpdates.last loop
          if anames(i) = succAttrUpdates(j)
             and itemkeys(i) = succItemUpdates(j) then

           -- remove the item/attr from the success table
           succItemUpdates.delete(j);
Line: 627

           succAttrUpdates.delete(j);
Line: 632

          j:=succItemUpdates.next(j);
Line: 642

      end if; --successUpdates count=0
Line: 643

   end if; --sucessUpdates doesnot match item count
Line: 682

  succAttrUpdates Wf_Engine.NameTabTyp;
Line: 683

  succItemUpdates Wf_Engine_Bulk.ItemKeyTabType;
Line: 705

  g_FailedItems.DELETE;
Line: 706

  g_FailedAttributes.DELETE;
Line: 712

      insert into WF_ITEM_ATTRIBUTE_VALUES
        (ITEM_TYPE, ITEM_KEY, NAME, DATE_VALUE)
      select itemtype, itemkeys(arrayIndex), anames(arrayIndex), Date_default
        from WF_ITEM_ATTRIBUTES WIA
        where
          WIA.ITEM_TYPE = itemtype
        and
          WIA.NAME = anames(arrayIndex)
        and not exists (select 1 from WF_ITEM_ATTRIBUTE_VALUES WIAV
          where WIAV.item_type=itemtype
          and  WIAV.item_key=itemkeys(arrayIndex)
          and  WIAV.NAME=anames(arrayIndex));
Line: 732

      update WF_ITEM_ATTRIBUTE_VALUES set
      DATE_VALUE = avalues(arrInd)
      where ITEM_TYPE = itemtype
      and ITEM_KEY = itemkeys(arrInd)
      and NAME = anames(arrInd)
     returning item_key,name bulk collect into succItemUpdates, succAttrUpdates;
Line: 751

   if (succItemUpdates.count <> itemkeys.COUNT) then
   -- determine the failed item/atrributes
      if succItemUpdates.count=0 then
          g_failedItems:=itemkeys;
Line: 760

         if ((itemkeys.count - i + 1) = succItemUpdates.count) then
          -- we are done, the rest are all successful
          exit;
Line: 765

         j:=succItemUpdates.first;
Line: 766

         while j <= succItemUpdates.last loop
          if anames(i) = succAttrUpdates(j)
             and itemkeys(i) = succItemUpdates(j) then

           -- remove the item/attr from the success table
           succItemUpdates.delete(j);
Line: 772

           succAttrUpdates.delete(j);
Line: 777

          j:=succItemUpdates.next(j);
Line: 787

      end if; --successUpdates count=0
Line: 788

   end if; --sucessUpdates doesnot match item count
Line: 867

  g_FailedItems.DELETE;
Line: 868

  g_SuccessItems.DELETE;
Line: 882

      Wf_Core.Raise('WFENG_ITEM_ROOT_SELECTOR');
Line: 907

  select INSTANCE_ID
  into rootid
  from WF_PROCESS_ACTIVITIES PA, WF_ACTIVITIES A
  where A.ITEM_TYPE = itemtype
  and A.NAME = 'ROOT'
  and actdate >= A.BEGIN_DATE
  and actdate < NVL(A.END_DATE, actdate+1)
  and PA.PROCESS_NAME = 'ROOT'
  and PA.PROCESS_ITEM_TYPE = itemtype
  and PA.PROCESS_VERSION = A.VERSION
  and PA.INSTANCE_LABEL = root;
Line: 944

         itemkeys.delete(arrInd);
Line: 945

         user_keys.delete(arrInd);
Line: 946

         owner_roles.delete(arrInd);
Line: 979

    insert into WF_ITEM_ATTRIBUTE_VALUES (
      ITEM_TYPE,
      ITEM_KEY,
      NAME,
      TEXT_VALUE
    ) values (
      itemtype,
      l_itemkeys(arrInd),
      wf_engine.eng_schema,
      schemaAttribute
    );
Line: 1000

         l_itemkeys.DELETE(SQL%BULK_EXCEPTIONS(failIndex).ERROR_INDEX);
Line: 1028

        insert into WF_ITEM_ATTRIBUTE_VALUES (
        ITEM_TYPE,
        ITEM_KEY,
        NAME,
        TEXT_VALUE
        ) values (
        itemtype,
        l_itemkeys(arrInd),
        '#LBL_'||parent_context,
        parent_context
        );
Line: 1049

                l_itemkeys.DELETE(SQL%BULK_EXCEPTIONS(failIndex).ERROR_INDEX);
Line: 1058

        update WF_ITEM_ATTRIBUTE_VALUES
        set NUMBER_VALUE = NUMBER_VALUE + l_count
        where NAME like '#CNT_%'
        and NUMBER_VALUE is not null
        and ITEM_TYPE = parent_itemType
        and ITEM_KEY = parent_itemKey;
Line: 1106

    SELECT PROCESS_ITEM_TYPE, PROCESS_NAME, PROCESS_VERSION,
           ACTIVITY_ITEM_TYPE, ACTIVITY_NAME, INSTANCE_ID,
           INSTANCE_LABEL, PERFORM_ROLE, PERFORM_ROLE_TYPE,
           START_END, DEFAULT_RESULT
    FROM   WF_PROCESS_ACTIVITIES WPA
    WHERE  WPA.PROCESS_ITEM_TYPE = itemtype
    AND    WPA.PROCESS_NAME = process
    AND    WPA.PROCESS_VERSION = version
    AND    WPA.START_END = wf_engine.eng_start
    AND NOT EXISTS (
      SELECT NULL
      FROM WF_ACTIVITY_TRANSITIONS WAT
      WHERE WAT.TO_PROCESS_ACTIVITY = WPA.INSTANCE_ID);
Line: 1176

  g_failedItems.DELETE;
Line: 1177

  g_successItems.DELETE;
Line: 1179

  select WI.ROOT_ACTIVITY, WI.ROOT_ACTIVITY_VERSION
  into   process,version
  from WF_ITEMS WI
  where WI.ITEM_TYPE = itemtype
  and WI.ITEM_KEY = l_itemkeys(1);
Line: 1212

      insert
        into WF_ITEM_ACTIVITY_STATUSES (
        ITEM_TYPE,
        ITEM_KEY,
        PROCESS_ACTIVITY,
        ACTIVITY_STATUS,
        ACTIVITY_RESULT_CODE,
        ASSIGNED_USER,
        NOTIFICATION_ID,
        BEGIN_DATE,
        END_DATE,
        DUE_DATE,
        EXECUTION_TIME,
        OUTBOUND_QUEUE_ID
      ) values (
        itemtype,
        l_itemkeys(arrInd),
        processid,
        wf_engine.eng_active,
        wf_engine.eng_null,
        null,
        null,
        SYSDATE,
        null,
        null,
        g_execCount,
       null
      );
Line: 1247

        l_itemkeys.DELETE(sql%bulk_exceptions(arrIndex).ERROR_INDEX);
Line: 1364

    WF_CACHE.ProcessStartActivities.DELETE;
Line: 1395

         dueDateTab.delete;
Line: 1397

         msgIdTab.delete;
Line: 1484

             l_itemkeys.DELETE(arrInd);
Line: 1498

                    l_itemkeys.delete(l_itemkeys.last);
Line: 1499

                    msgIdTab.delete(msgIdTab.last);
Line: 1500

                    duedateTab.delete(duedateTab.last);
Line: 1511

        insert
        into WF_ITEM_ACTIVITY_STATUSES (
        ITEM_TYPE,
        ITEM_KEY,
        PROCESS_ACTIVITY,
        ACTIVITY_STATUS,
        ACTIVITY_RESULT_CODE,
        ASSIGNED_USER,
        NOTIFICATION_ID,
        BEGIN_DATE,
        END_DATE,
        DUE_DATE,
        EXECUTION_TIME,
        OUTBOUND_QUEUE_ID
      ) values (
        itemtype,
        l_itemkeys(arrInd),
        childarr(i),
        'DEFERRED',
        null,
        null,
        null,
        SYSDATE,
        null,
        duedateTab(arrInd),
        g_execCount,
        msgIdTab(arrInd)
      );
Line: 1546

              l_itemkeys.DELETE(sql%bulk_exceptions(failindex).error_index);
Line: 1682

     g_SuccessItems.DELETE;
Line: 1689

     select WI.ROOT_ACTIVITY_VERSION
     into   version
     from WF_ITEMS WI
     where WI.ITEM_TYPE = itemtype
     and WI.ITEM_KEY = l_itemkeys(1)
     and WI.ROOT_ACTIVITY=process;
Line: 1725

    SELECT WPA.INSTANCE_ID
    into actid
    FROM   WF_PROCESS_ACTIVITIES WPA
    WHERE  WPA.PROCESS_ITEM_TYPE = itemtype
    AND    WPA.PROCESS_NAME = process
    AND    WPA.PROCESS_VERSION = version
    AND    WPA.START_END = wf_engine.eng_start
    AND    WPA.INSTANCE_LABEL=activity;
Line: 1751

      insert
        into WF_ITEM_ACTIVITY_STATUSES (
        ITEM_TYPE,
        ITEM_KEY,
        PROCESS_ACTIVITY,
        ACTIVITY_STATUS,
        ACTIVITY_RESULT_CODE,
        ASSIGNED_USER,
        NOTIFICATION_ID,
        BEGIN_DATE,
        END_DATE,
        DUE_DATE,
        EXECUTION_TIME,
        OUTBOUND_QUEUE_ID
      ) values (
        itemtype,
        l_itemkeys(arrInd),
        processid,
        wf_engine.eng_active,
        wf_engine.eng_null,
        null,
        null,
        SYSDATE,
        null,
        null,
        g_execCount,
       null
      );
Line: 1786

        l_itemkeys.DELETE(sql%bulk_exceptions(arrIndex).ERROR_INDEX);
Line: 1818

       dueDateTab.delete;
Line: 1820

       msgIdTab.delete;
Line: 1910

                 l_itemkeys.DELETE(arrInd);
Line: 1926

                    l_itemkeys.delete(l_itemkeys.last);
Line: 1927

                    msgIdTab.delete(msgIdTab.last);
Line: 1928

                    duedateTab.delete(duedateTab.last);
Line: 1938

        insert
        into WF_ITEM_ACTIVITY_STATUSES (
        ITEM_TYPE,
        ITEM_KEY,
        PROCESS_ACTIVITY,
        ACTIVITY_STATUS,
        ACTIVITY_RESULT_CODE,
        ASSIGNED_USER,
        NOTIFICATION_ID,
        BEGIN_DATE,
        END_DATE,
        DUE_DATE,
        EXECUTION_TIME,
        OUTBOUND_QUEUE_ID
      ) values (
        itemtype,
        l_itemkeys(arrInd),
	actid,
        nvl(activityStatus,'DEFERRED'),
        null,
        null,
        null,
        SYSDATE,
        null,
        duedateTab(arrInd),
        g_execCount,
        msgIdTab(arrInd)
      );
Line: 1972

              l_itemkeys.DELETE(sql%bulk_exceptions(failindex).error_index);