DBA Data[Home] [Help]

APPS.JTF_CALENDAR_PUB_24HR SQL Statements

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

Line: 215

    select shift_id,(shift_end_date - shift_start_date) shift_duration
      from jtf_cal_shift_assign
     where calendar_id = p_calendar_id
  order by shift_sequence_number;
Line: 223

    select shift_construct_id,
           begin_time start_constr,
           end_time end_constr,
           availability_type_code
      from jtf_cal_shift_constructs
     where shift_id = p_shift_id
       and ((start_date_active <=p_day and end_date_active IS NULL) /* bug# 2408759 */
             or (p_day between start_date_active and end_date_active))
       and (
             (
               trunc(begin_time) <= trunc(p_uot_value)
               and
               trunc(end_time)  >= trunc(p_uot_value)
              )
            or
             (
               trunc(begin_time) <= to_date('1995/01/07','YYYY/MM/DD') +
                                        to_number(substr(to_char(trunc(p_uot_value), 'YYYY/MM/DD'),9,2))
               and
               trunc(end_time)  >= to_date('1995/01/07','YYYY/MM/DD') +
                                     to_number(substr(to_char(trunc(p_uot_value), 'YYYY/MM/DD'),9,2))
              )
           )
   order by begin_time;
Line: 253

    select Decode(p_tz_enabled,'Y',
                      Decode(p_res_Timezone_id,NULL, e.start_date_time,
                             Nvl(HZ_TIMEZONE_PUB.CONVERT_DATETIME(p_res_Timezone_id,
                                                                  p_server_tz_id,
                                                                  e.start_date_time),
                                 e.start_date_time)
                            ),
                      e.start_date_time) 			 start_except,
           Decode(p_tz_enabled,'Y',
                      Decode(p_res_Timezone_id,NULL, e.end_date_time,
                             Nvl(HZ_TIMEZONE_PUB.CONVERT_DATETIME(p_res_Timezone_id,
                                                                  p_server_tz_id,
                                                                  e.end_date_time),
                                 e.end_date_time)
                            ),
                      e.end_date_time)   end_except,
           nvl(Decode(p_tz_enabled,'Y',
                      Decode(p_res_Timezone_id,NULL, a.start_date_active,
                             Nvl(HZ_TIMEZONE_PUB.CONVERT_DATETIME(p_res_Timezone_id,
                                                                  p_server_tz_id,
                                                                  a.start_date_active),
                                 a.start_date_active)
                            ),
                      a.start_date_active) ,p_start) start_assign,
           nvl(Decode(p_tz_enabled,'Y',
                      Decode(p_res_Timezone_id,NULL, a.end_date_active,
                             Nvl(HZ_TIMEZONE_PUB.CONVERT_DATETIME(p_res_Timezone_id,
                                                                  p_server_tz_id,
                                                                  a.end_date_active),
                                 a.end_date_active)
                            ),
                      a.end_date_active),p_end) end_assign
      from jtf_cal_exception_assign a
           ,jtf_cal_exceptions_b    e
     where a.calendar_id  = p_calendar_id
       and a.exception_id = e.exception_id
       and Decode(p_tz_enabled,'Y',
                      Decode(p_res_Timezone_id,NULL, e.start_date_time,
                             Nvl(HZ_TIMEZONE_PUB.CONVERT_DATETIME(p_res_Timezone_id,
                                                                  p_server_tz_id,
                                                                  e.start_date_time),
                                 e.start_date_time)
                            ),
                      e.start_date_time) <= p_end
       and Decode(p_tz_enabled,'Y',
                      Decode(p_res_Timezone_id,NULL, e.end_date_time,
                             Nvl(HZ_TIMEZONE_PUB.CONVERT_DATETIME(p_res_Timezone_id,
                                                                  p_server_tz_id,
                                                                  e.end_date_time),
                                 e.end_date_time)
                            ),
                      e.end_date_time) >= p_start
       and nvl(Decode(p_tz_enabled,'Y',
                      Decode(p_res_Timezone_id,NULL, a.start_date_active,
                             Nvl(HZ_TIMEZONE_PUB.CONVERT_DATETIME(p_res_Timezone_id,
                                                                  p_server_tz_id,
                                                                  a.start_date_active),
                                 a.start_date_active)
                            ),
                      a.start_date_active),p_end) <= p_end --starts before end of range
       and nvl(Decode(p_tz_enabled,'Y',
                      Decode(p_res_Timezone_id,NULL, a.end_date_active,
                             Nvl(HZ_TIMEZONE_PUB.CONVERT_DATETIME(p_res_Timezone_id,
                                                                  p_server_tz_id,
                                                                  a.end_date_active),
                                 a.end_date_active)
                            ),
                      a.end_date_active),p_start) >= p_start -- end after start of range
 UNION ALL
    -- For bug 4547539, added db index skip hint to force db to use second indexed
    -- column schedule_end_date for index search
    -- Removed /*+ index_ss(T JTF_TASKS_B_N12) */ Hint to address performance issue Bug # 5167257 By MPADHIAR

    select   Decode(p_tz_enabled,'Y',
                      Decode(t.timezone_id,NULL, t.scheduled_start_date,
                             Nvl(HZ_TIMEZONE_PUB.CONVERT_DATETIME(t.timezone_id,
                                                                  p_server_tz_id,
                                                                  t.scheduled_start_date),
                                 t.scheduled_start_date)
                            ),
                      t.scheduled_start_date) 			start_except,
           Decode(p_tz_enabled,'Y',
                      Decode(t.timezone_id,NULL, t.scheduled_end_date,
                             Nvl(HZ_TIMEZONE_PUB.CONVERT_DATETIME(t.timezone_id,
                                                                  p_server_tz_id,
                                                                  t.scheduled_end_date),
					   t.scheduled_end_date)
                            ),
                      t.scheduled_end_date)                 end_except,
           p_start start_assign,
           p_end end_assign
      from jtf_tasks_b t,
           jtf_task_assignments a,
           jtf_task_statuses_b s
     where a.resource_id = p_res_id
       and a.resource_type_code = p_res_type
       and Decode(p_tz_enabled,'Y',
                      Decode(t.timezone_id,NULL, t.scheduled_start_date,
                             Nvl(HZ_TIMEZONE_PUB.CONVERT_DATETIME(t.timezone_id,
                                                                  p_server_tz_id,
                                                                  t.scheduled_start_date),
                                 t.scheduled_start_date)
                            ),
                      t.scheduled_start_date)
                <= (trunc(p_end)+86399/84400)
       and Decode(p_tz_enabled,'Y',
                      Decode(t.timezone_id,NULL, t.scheduled_end_date,
                             Nvl(HZ_TIMEZONE_PUB.CONVERT_DATETIME(t.timezone_id,
                                                                  p_server_tz_id,
                                                                  t.scheduled_end_date),
					   t.scheduled_end_date)
                            ),
                      t.scheduled_end_date)
                  >= trunc(p_start)
       and s.task_status_id = a.assignment_status_id
       and t.task_id = a.task_id
       and nvl(s.cancelled_flag,'N') <> 'Y'
    and nvl(s.completed_flag,'N') <> 'Y'
    and t.scheduled_start_date <> t.scheduled_end_date
    order by 1,2; -- bug # 2520762
Line: 376

    select a.calendar_id, a.start_date_time, a.end_date_time,b.start_date_active, b.end_date_active
      from jtf_cal_resource_assign a,
           jtf_calendars_b b
     where a.resource_id = p_res_id
       and a.resource_type_code = p_res_type
       and a.calendar_id = b.calendar_id
       and a.primary_calendar_flag = 'Y'
       and trunc(a.start_date_time) <= p_end
       and nvl(trunc(a.end_date_time),p_start) >= p_start
       and trunc(b.start_date_active) <= p_end
       and nvl(trunc(b.end_date_active),p_start) >= p_start
  order by b.start_date_active;
Line: 501

    l_shift_tbl.delete;
Line: 588

        l_tbl.delete;
Line: 669

                         l_tbl.delete(l_idx);
Line: 686

                         l_tbl.delete(l_idx);
Line: 733

               x_shift.delete;
Line: 1093

  select shift_id,(shift_end_date - shift_start_date) shift_duration
    from jtf_cal_shift_assign
   where calendar_id = p_calendar_id
order by shift_sequence_number;
Line: 1101

select shift_construct_id,
       begin_time start_constr,
       end_time end_constr,
       availability_type_code
  from jtf_cal_shift_constructs
 where shift_id = p_shift_id
   and ((start_date_active <=p_day and end_date_active IS NULL)   /* bug# 2408759 */
             or (p_day between start_date_active and end_date_active))
          and (
                (
                   trunc(begin_time) <= trunc(p_uot_value)
                   and
                   trunc(end_time)  >= trunc(p_uot_value)
                 )
                 or
                (
               trunc(begin_time) <= to_date('1995/01/07','YYYY/MM/DD') +
                                        to_number(substr(to_char(trunc(p_uot_value), 'YYYY/MM/DD'),9,2))
               and
               trunc(end_time)  >= to_date('1995/01/07','YYYY/MM/DD') +
                                     to_number(substr(to_char(trunc(p_uot_value), 'YYYY/MM/DD'),9,2))
                )
              ) ;
Line: 1126

select e.start_date_time start_except
      ,e.end_date_time   end_except
  from jtf_cal_exception_assign a
      ,jtf_cal_exceptions_vl    e
 where a.calendar_id  = p_calendar_id
   and a.exception_id = e.exception_id
    -- validate exception assignment
   and (
        ( p_day >= trunc(a.start_date_active)
                  or a.start_date_active is null
        )
        and
        ( p_day <= trunc(a.end_date_active)
                  or a.end_date_active is null
        )
             -- validate exception
        and
        (
          p_day between trunc(e.start_date_time) and trunc(e.end_date_time)
        )
       );
Line: 1219

    select resource_name
    into l_resource_name
    --from jtf_rs_all_resources_vl
    --Modified by jawang to fix the bug 2416932
    from jtf_task_resources_vl
    where resource_id = p_resource_id
    and  resource_type = p_resource_type;
Line: 1240

     select a.calendar_id,b.calendar_name,b.start_date_active,a.start_date_time
     into   l_calendar_id,l_calendar_name,l_calendar_start_date,l_start_date_time
     from   jtf_cal_resource_assign a,
              jtf_calendars_vl b
     where  a.resource_id = p_resource_id
     and    a.resource_type_code = p_resource_type
     and    a.calendar_id = b.calendar_id
     and    a.primary_calendar_flag = 'Y'
--  Commented for bug 3891896 by ABRAINA
--     and    l_shift_date between trunc(a.start_date_time) and nvl(trunc(a.end_date_time),to_date(get_g_miss_date,'DD/MM/RRRR'));
Line: 1260

       l_tbl.delete;
Line: 1264

         select sum(shift_end_date - shift_start_date)
         into   l_shifts_total_duration
         from   jtf_cal_shift_assign
         where  calendar_id = l_calendar_id;
Line: 1312

      l_tbl.delete;
Line: 1414

            l_tbl.delete;
Line: 1422

            l_tbl.delete;
Line: 1427

            l_tbl.delete;
Line: 1435

            l_tbl.delete;
Line: 1443

            l_tbl.delete;
Line: 1448

            l_tbl.delete; -- if we find the exception and shift times are same then delete the row from table of records.
Line: 1530

	l_tbl.delete;  -- to delete the record from TOR if no shift found
Line: 1653

    select shift_id,(shift_end_date - shift_start_date) shift_duration
    from   jtf_cal_shift_assign
    where  calendar_id = p_calendar_id
    order by shift_sequence_number;
Line: 1662

    select shift_construct_id,
           begin_time start_constr,
           end_time end_constr,
           availability_type_code,
           attribute1,
           attribute2,
           attribute3,
           attribute4,
           attribute5,
           attribute6,
           attribute7,
           attribute8,
           attribute9,
           attribute10,
           attribute11,
           attribute12,
           attribute13,
           attribute14,
           attribute15
    from   jtf_cal_shift_constructs
    where  shift_id = p_shift_id
        and ((start_date_active <=p_day and end_date_active IS NULL)  /* bug# 2408759 */
             or (p_day between start_date_active and end_date_active))
--  and    unit_of_time_value = p_uot_value;
Line: 1708

     select e.start_date_time start_except
    ,      e.end_date_time   end_except
    from jtf_cal_exception_assign a
    ,    jtf_cal_exceptions_vl    e
    where a.calendar_id  = p_calendar_id
    and   a.exception_id = e.exception_id
    -- validate exception assignment
    and   (
               ( p_day >= trunc(a.start_date_active)
                       or a.start_date_active is null
               )
             and
              ( p_day <= trunc(a.end_date_active)
                           or a.end_date_active is null
              )
             -- validate exception
             and
               (
                  p_day between trunc(e.start_date_time) and trunc(e.end_date_time)
                )
           );
Line: 1805

    select resource_name
    into l_resource_name
    --from jtf_rs_all_resources_vl
    --Modified by jawang to fix the bug 2416932
    from jtf_task_resources_vl
    where resource_id = p_resource_id
    and  resource_type = p_resource_type;
Line: 1837

       select a.calendar_id,b.calendar_name,b.start_date_active,a.start_date_time
       into   l_calendar_id,l_calendar_name,l_calendar_start_date,l_start_date_time
       from   jtf_cal_resource_assign a,
              jtf_calendars_vl b
       where  a.resource_id = p_resource_id
       and    a.resource_type_code = p_resource_type
       and    a.calendar_id = b.calendar_id
       and    a.primary_calendar_flag = 'Y'
--  Commented for bug 3891896 by ABRAINA
--       and    l_shift_date between trunc(a.start_date_time) and nvl(trunc(a.end_date_time),to_date(get_g_miss_date,'DD/MM/RRRR'));
Line: 1857

       l_tbl.delete;
Line: 1861

        select sum(shift_end_date - shift_start_date)
        into   l_shifts_total_duration
        from   jtf_cal_shift_assign
        where  calendar_id = l_calendar_id;
Line: 1909

      l_tbl.delete;
Line: 2059

            l_tbl.delete;
Line: 2086

            l_tbl.delete;
Line: 2091

            l_tbl.delete;
Line: 2117

            l_tbl.delete;
Line: 2144

            l_tbl.delete;
Line: 2150

            l_tbl.delete; -- if we find the exception and shift times are same then delete the row from table of records.
Line: 2252

        l_tbl.delete;  -- to delete the record from TOR if no shift found
Line: 2458

   select shift_id,(shift_end_date - shift_start_date) shift_duration
     from jtf_cal_shift_assign
    where calendar_id = p_calendar_id
 order by shift_sequence_number;
Line: 2464

   select shift_construct_id,
          begin_time shift_begin_time,
          end_time shift_end_time,
          availability_type_code
     from jtf_cal_shift_constructs
    where shift_id = p_shift_id
      and ((start_date_active <=p_day and end_date_active IS NULL)  /* bug# 2408759 */
             or (p_day between start_date_active and end_date_active))
      and
            (
             (
               trunc(begin_time) <= trunc(p_uot_value)
               and
               trunc(end_time)  >= trunc(p_uot_value)
             )
            or
            (
               trunc(begin_time) <= to_date('1995/01/07','YYYY/MM/DD') +
                                        to_number(substr(to_char(trunc(p_uot_value), 'YYYY/MM/DD'),9,2))
               and
               trunc(end_time)  >= to_date('1995/01/07','YYYY/MM/DD') +
                                     to_number(substr(to_char(trunc(p_uot_value), 'YYYY/MM/DD'),9,2))
            )
           )
 order by begin_time;
Line: 2491

   select e.start_date_time  excp_start_time,
          e.end_date_time excp_end_time
     from jtf_cal_exceptions_vl e, jtf_cal_exception_assign a
    where a.calendar_id  = p_calendar_id
      and a.exception_id = e.exception_id
      and (
               ( p_day >= trunc(a.start_date_active)
                       or a.start_date_active is null
               )
           and
              ( p_day <= trunc(a.end_date_active)
                           or a.end_date_active is null
              )
             -- validate exception
             and
               (
                  p_day between trunc(e.start_date_time) and trunc(e.end_date_time)
                )
           ) ;
Line: 2519

   select /*+ index_ss(T JTF_TASKS_B_N12) */
          trunc(Decode(p_tz_enabled,'Y',
                       Decode(t.timezone_id,NULL, t.scheduled_start_date,
                              Nvl(HZ_TIMEZONE_PUB.CONVERT_DATETIME(t.timezone_id,
                                                                   p_server_tz_id,
                                                                   t.scheduled_start_date),
                                  t.scheduled_start_date)
                             ),
                       t.scheduled_start_date)
               ) task_start_date,
          trunc(Decode(p_tz_enabled,'Y',
                       Decode(t.timezone_id,NULL, t.scheduled_end_date,
                              Nvl(HZ_TIMEZONE_PUB.CONVERT_DATETIME(t.timezone_id,
                                                                   p_server_tz_id,
                                                                   t.scheduled_end_date),
				          t.scheduled_end_date)
                             ),
                       t.scheduled_end_date)
               )  task_end_date,
          Decode(p_tz_enabled,'Y',
                 Decode(t.timezone_id,NULL, t.scheduled_start_date,
                        Nvl(HZ_TIMEZONE_PUB.CONVERT_DATETIME(t.timezone_id,
                                                             p_server_tz_id,
                                                             t.scheduled_start_date),
                            t.scheduled_start_date)
                       ),
                 t.scheduled_start_date)   task_start_time,
          Decode(p_tz_enabled,'Y',
                 Decode(t.timezone_id,NULL, t.scheduled_end_date,
                        Nvl(HZ_TIMEZONE_PUB.CONVERT_DATETIME(t.timezone_id,
                                                             p_server_tz_id,
                                                             t.scheduled_end_date),
				    t.scheduled_end_date)
                       ),
                 t.scheduled_end_date)  task_end_time
    from  jtf_tasks_b t,
          jtf_task_assignments a,
          jtf_task_statuses_b s
   where  a.resource_id = p_res_id
     and  a.resource_type_code = p_res_type
     and  p_req_date between
                             trunc(Decode(p_tz_enabled,'Y',
                                          Decode(t.timezone_id,NULL, t.scheduled_start_date,
                                                 Nvl(HZ_TIMEZONE_PUB.CONVERT_DATETIME(t.timezone_id,
                                                                                      p_server_tz_id,
                                                                                      t.scheduled_start_date),
                                                     t.scheduled_start_date)
                                                ),
                                          t.scheduled_start_date)
                                  )
                         and
                                  Decode(p_tz_enabled,'Y',
                                          Decode(t.timezone_id,NULL, t.scheduled_end_date,
                                                 Nvl(HZ_TIMEZONE_PUB.CONVERT_DATETIME(t.timezone_id,
                                                                                      p_server_tz_id,
                                                                                      t.scheduled_end_date),
                                                     t.scheduled_end_date)
                                                 ),
                                          t.scheduled_end_date)
     and  s.task_status_id = a.assignment_status_id
     AND  t.task_id = a.task_id
     and  nvl(s.cancelled_flag,'N') <> 'Y'
     and  nvl(s.completed_flag,'N') <> 'Y'
     and  t.scheduled_start_date <> t.scheduled_end_date ; -- bug # 2520762
Line: 2640

    select resource_name
    into l_resource_name
    --from jtf_rs_all_resources_vl
    --Modified by jawang to fix the bug 2416932
    from jtf_task_resources_vl
    where resource_id = p_resource_id
    and  resource_type = p_resource_type;
Line: 2656

x_shift.delete;
Line: 2660

l_shift.delete;
Line: 2662

  select a.calendar_id,b.calendar_name,b.start_date_active
  into   l_calendar_id,l_calendar_name,l_calendar_start_date
  from   jtf_cal_resource_assign a,
         jtf_calendars_vl b
  where  a.resource_id = p_resource_id
  and    a.resource_type_code = p_resource_type
  and    a.calendar_id = b.calendar_id
  and    a.primary_calendar_flag = 'Y'
--  Commented for bug 3891896 by ABRAINA
--  and    l_shift_date between trunc(a.start_date_time) and nvl(trunc(a.end_date_time),to_date(get_g_miss_date,'DD/MM/RRRR'));
Line: 2682

    select sum(shift_end_date - shift_start_date)
    into   l_shifts_total_duration
    from   jtf_cal_shift_assign
    where  calendar_id = l_calendar_id;
Line: 2687

    select mod((l_shift_date - l_calendar_start_date),l_shifts_total_duration)
    into   l_left_days
    from dual;
Line: 2704

    select to_char(l_shift_date, 'd')
    into   l_unit_of_time_value
    from dual;
Line: 2995

   SELECT 1 INTO nDummy FROM jtf_task_resources_vl
   WHERE resource_id = p_resource_id AND resource_type = p_resource_type
   AND  ((start_date_active IS NULL AND end_date_active IS NULL)
      OR (start_date_active <= SYSDATE AND end_date_active IS NULL)
      OR (SYSDATE BETWEEN start_date_active AND end_date_active));
Line: 3088

 Select TIME_ZONE
   From JTF_RS_RESOURCE_EXTNS
  Where RESOURCE_ID = p_resource_id
    AND 'RS_'||category = p_resource_type
    And trunc(sysdate) between trunc(nvl(START_DATE_ACTIVE,sysdate))
                           and trunc(nvl(END_DATE_ACTIVE,sysdate));
Line: 3096

 SELECT TIME_ZONE
   FROM JTF_RS_GROUPS_B
  WHERE group_id = p_resource_id
    AND trunc(SYSDATE) BETWEEN trunc(nvl(START_DATE_ACTIVE,SYSDATE))
                           AND trunc(nvl(END_DATE_ACTIVE,SYSDATE));
Line: 3127

 select 1
   into v_valid_cal
   from jtf_calendars_vl a
  where calendar_id = P_Calendar_Id
--  Commented for bug 3891896 by ABRAINA
--    and P_shift_date between trunc(a.start_date_active) and nvl(trunc(a.end_date_active),to_date(get_g_miss_date,'DD/MM/RRRR'));