DBA Data[Home] [Help]

APPS.WIP_INFRESSCHED_GRP SQL Statements

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

Line: 787

                                         p_delete_stack => fnd_api.g_false);
Line: 955

   Will delete the -1 shifts together later, otherwise with everyloop
   there will be sorting of the records required, which will have
   performance impact.*/
   x_shifts.shiftNum(i) := -1;
Line: 982

   Will delete the -1 shifts together later, otherwise with everyloop
   there will be sorting of the records required, which will have
   performance impact.*/
   x_shifts.shiftNum(i) := -1;
Line: 1031

 /*Looping in x_shifts to delete overlapping shifts and to create one most inclusive shifts.
 Since shifts are getting merged thus Shift Numbers may be incorrect after this processing.
 But in later part of the code, Shift Numbers are not needed and only start and end times
 are used.*/
 while(l_overlap_exists) loop
  if (l_logLevel <= wip_constants.trace_logging) then
  wip_logger.log('while loop begins', l_retStatus);
Line: 1074

    wip_logger.log('deleted counter: ' || i, l_retStatus);
Line: 1087

  /*Trim the remaining shifts. These shifts are deleted above and have shiftNum as -1*/
  x_shifts.shiftNum.trim(l_count-l_count2);
Line: 1124

      select brs.shift_num,
             bsd.shift_date + bst.from_time/86400,
	     --added the below case statement for bug 16481026.
	     -- This fix is to consider the resource scheduled from 00:00:00 to 00:00:00 properly
	     -- to ensure that the start time and end time for such resource are not same.
	     CASE WHEN (bst.to_time = bst.from_time or bst.to_time < bst.from_time)
              THEN bsd.shift_date + bst.to_time/86400 + 1
             ELSE
              bsd.shift_date + bst.to_time/86400
             END
             --bsd.shift_date + bst.to_time/86400
        from bom_resource_shifts brs,
             mtl_parameters mp,
             bom_shift_dates bsd,
             bom_shift_times bst,
             bom_department_resources bdr
       where bdr.department_id = v_deptID
         and bdr.resource_id = v_resID
         and brs.resource_id = bdr.resource_id
         and brs.department_id = nvl(bdr.share_from_dept_id,bdr.department_id)
         and mp.organization_id = v_orgID
         and mp.calendar_code = bsd.calendar_code
         and mp.calendar_exception_set_id = bsd.exception_set_id
         and brs.shift_num = bsd.shift_num
         and bsd.shift_date between v_startDate and v_endDate --don't incorporate time into this check as it slows the query
         and bsd.seq_num is not null
         and bst.shift_num = bsd.shift_num
         and bst.calendar_code = bsd.calendar_code
       order by bsd.shift_date, bst.from_time;
Line: 1160

      select -1 shiftNum,
             bcd.calendar_date + wl.start_time/86400,
             bcd.calendar_date + wl.stop_time/86400
        from mtl_parameters mp,
             bom_calendar_dates bcd,
             wip_lines wl
       where mp.organization_id = v_orgID
         and mp.calendar_code = bcd.calendar_code
         and mp.calendar_exception_set_id = bcd.exception_set_id
         and wl.line_id = v_repLineID
         and bcd.seq_num is not null --working day
         and bcd.calendar_date between v_startDate and v_endDate
       order by bcd.calendar_date;
Line: 1177

      select -1,
             bcd.calendar_date,
             bcd.calendar_date + 1
        from mtl_parameters mp,
             bom_calendar_dates bcd
       where mp.organization_id = v_orgID
         and mp.calendar_code = bcd.calendar_code
         and mp.calendar_exception_set_id = bcd.exception_set_id
         and bcd.calendar_date between v_startDate and v_endDate
         and bcd.seq_num is not null
       order by bcd.calendar_date;
Line: 1238

    select 1
    into l_dummy
    from dual
    where exists (select 1
                    from bom_resource_shifts brs,
                         bom_department_resources bdr
                   where bdr.department_id = x_resTbls.deptID(p_idx)
                     and bdr.resource_id = x_resTbls.resID(p_idx)
                     and brs.resource_id = bdr.resource_id
                     and brs.department_id = nvl(bdr.share_from_dept_id,bdr.department_id)
                     and brs.shift_num is not null
                     and rownum = 1);
Line: 1545

                       It will change the resource shifts (add day, delete day, modify shift times) as per capacity
         exceptions.
   */
   procedure capacityExceptions(p_resID     IN NUMBER,
                                p_deptID    IN NUMBER,
                                p_orgID     IN NUMBER,
                                x_shifts    IN OUT NOCOPY shift_recTbl_t,
           x_returnStatus OUT NOCOPY VARCHAR2) is

    /*bug 10251978 (FP 10086620): Modified the cursor to include capacity_units value from bom_resource_shifts table*/
     cursor c_capacityDtls(v_resID  NUMBER,
                           v_deptID NUMBER,
      v_orgID  NUMBER) is
      select  brc.shift_num,
              brc.from_date,
       brc.to_date,
       brc.from_time,
       brc.to_time,
       brc.capacity_change,
       brc.action_type,
       brs.capacity_units
         from bom_resource_changes brc,
       crp_simulation_sets crp,
       BOM_RESOURCE_SHIFTS brs
        where brc.department_id = v_deptID
   and brc.resource_id = v_resID
   and crp.organization_id = v_orgID
   and crp.simulation_set  =  brc.simulation_set
   and crp.use_in_wip_flag = 1
   and brs.department_id = v_deptID
    and brs.resource_id = v_resID
   and brs.shift_num = brc.shift_num;
Line: 1641

                This will avoid shift being deleted if customer define shift start time and endtime the same as 00:00:00*/
      if(l_capacity.count = 0) then
         if(l_logLevel <= wip_constants.trace_logging) then
            wip_logger.log('No Capacity Exception found. exiting capacity exception', l_retStatus);
Line: 1669

        l_capacity.DELETE;
Line: 1672

        l_capacity_2.DELETE;
Line: 1702

          if (l_capacity(i).actionType = wip_constants.DELETE_WKDY) THEN     -- delete a working day
    /* If more than one shift exists for a day (in case of shift with breakups) then it will
       delete all those shifts for that day. */
            if(l_logLevel <= wip_constants.trace_logging) then
        wip_logger.log('inside delete a working day', l_retStatus);
Line: 1709

           /* Changed IF condition to WHILE loop  to delete all the shifts for the given day */
           WHILE ( j <= l_lastRow AND Trunc(l_capacity(i).fromDate) = Trunc(x_shifts.startDate(j)) )  LOOP
      l_currRow := j;                               -- row that needs to be deleted
Line: 1724

                    l_lastRow :=  x_shifts.shiftNum.LAST;        -- updated last row
Line: 1742

                  x_shifts.shiftNum.extend;   -- extend the xshifts table by one row and insert the day and then shift remaning days
Line: 1851

       x_shifts.shiftNum.extend;   -- extend the xshifts table by one row and insert the day and then shift remaning days
Line: 1914

         l_lastRow :=  x_shifts.shiftNum.LAST;        -- updated last row
Line: 1918

         j :=  x_shifts.shiftNum.PRIOR(j);            -- update j as one shift record is deleted
Line: 1945

        x_shifts.shiftNum.extend;   -- extend the xshifts table by one row and insert the day and then shift remaning days
Line: 1996

   l_lastRow :=  x_shifts.shiftNum.LAST;        -- updated last row
Line: 2072

    select bc.calendar_end_date
      into l_maxDate
      from bom_calendars bc, mtl_parameters mp
     where mp.organization_id = p_orgID
       and mp.calendar_code = bc.calendar_code;
Line: 2247

      select brs.shift_num shiftNum,
             bsd.shift_date + bst.from_time/86400,
	     --added the below case statement for bug 16481026.
	     -- This fix is to consider the resource scheduled from 00:00:00 to 00:00:00 properly
	     -- to ensure that the start time and end time for such resource are not same.
	     CASE WHEN (bst.to_time = bst.from_time or bst.to_time < bst.from_time)
              THEN bsd.shift_date + bst.to_time/86400 + 1
             ELSE
              bsd.shift_date + bst.to_time/86400
             END
             --bsd.shift_date + bst.to_time/86400
        from bom_resource_shifts brs,
             mtl_parameters mp,
             bom_shift_dates bsd,
             bom_shift_times bst,
             bom_department_resources bdr
       where bdr.department_id = v_deptID
         and bdr.resource_id = v_resID
         and brs.resource_id = bdr.resource_id
         and brs.department_id = nvl(bdr.share_from_dept_id,bdr.department_id)
         and mp.organization_id = v_orgID
         and mp.calendar_code = bsd.calendar_code
         and mp.calendar_exception_set_id = bsd.exception_set_id
         and brs.shift_num = bsd.shift_num
         and bsd.shift_date between v_startDate and v_endDate --don't incorporate time into this check as it slows the query
         and bsd.seq_num is not null
         and bst.shift_num = bsd.shift_num
         and bst.calendar_code = bsd.calendar_code
       order by bsd.shift_date desc, bst.from_time desc;
Line: 2280

      select -1,
             bcd.calendar_date,
             bcd.calendar_date + 1
        from mtl_parameters mp,
             bom_calendar_dates bcd
       where mp.organization_id = v_orgID
         and mp.calendar_code = bcd.calendar_code
         and mp.calendar_exception_set_id = bcd.exception_set_id
         and bcd.calendar_date between v_startDate and v_endDate
         and bcd.seq_num is not null
       order by bcd.calendar_date desc;
Line: 2299

      select -1 shiftNum,
             bcd.calendar_date + wl.start_time/86400,
             bcd.calendar_date + wl.stop_time/86400
        from mtl_parameters mp,
             bom_calendar_dates bcd,
             wip_lines wl
       where mp.organization_id = v_orgID
         and mp.calendar_code = bcd.calendar_code
         and mp.calendar_exception_set_id = bcd.exception_set_id
         and wl.line_id = v_repLineID
         and bcd.seq_num is not null --working day
         and bcd.calendar_date between v_startDate and v_endDate --use stop_time to comsume tail end of a shift
       order by bcd.calendar_date desc;
Line: 2363

    select 1
    into l_dummy
    from dual
    where exists (select 1
                    from bom_resource_shifts brs,
                         bom_department_resources bdr
                   where bdr.department_id = x_resTbls.deptID(p_idx)
                     and bdr.resource_id = x_resTbls.resID(p_idx)
                     and brs.resource_id = bdr.resource_id
                     and brs.department_id = nvl(bdr.share_from_dept_id,bdr.department_id)
                     and brs.shift_num is not null
                     and rownum = 1);
Line: 2750

    select bc.calendar_start_date
      into l_minDate
      from bom_calendars bc, mtl_parameters mp
     where mp.organization_id = p_orgID
       and mp.calendar_code = bc.calendar_code;
Line: 3068

      x_resTbls.usgStartDate.delete;
Line: 3069

      x_resTbls.usgEndDate.delete;
Line: 3070

      x_resTbls.usgCumMinProcTime.delete;
Line: 3071

      x_resTbls.usgStartIdx.delete;
Line: 3072

      x_resTbls.usgEndIdx.delete;
Line: 3075

      x_resTbls.startDate.delete;
Line: 3076

      x_resTbls.endDate.delete;
Line: 3231

      x_resTbls.usgStartDate.delete;
Line: 3232

      x_resTbls.usgEndDate.delete;
Line: 3233

      x_resTbls.usgCumMinProcTime.delete;
Line: 3234

      x_resTbls.usgStartIdx.delete;
Line: 3235

      x_resTbls.usgEndIdx.delete;
Line: 3238

      x_resTbls.startDate.delete;
Line: 3239

      x_resTbls.endDate.delete;
Line: 3360

        select resource_code
          into l_resCode
          from bom_resources
         where resource_id = p_resTbls.resID(i);