DBA Data[Home] [Help]

APPS.RLM_DP_SV SQL Statements

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

Line: 31

  v_select_clause      VARCHAR2(32000);
Line: 91

     SELECT hsecs INTO l_start_time from v$timer;
Line: 149

        v_where_clause :=  v_where_clause || ' AND header_id NOT IN (Select header_id from rlm_schedule_interface_lines_v ril
        where ((ril.cust_ship_from_org_ext <> :p_cust_ship_from_ext) OR (ril.cust_ship_from_org_ext is  NULL)) AND
        ril.process_status <> 5)' ;
Line: 198

       g_BindVarTab.DELETE;
Line: 206

     v_select_clause  := 'SELECT hdr.header_id, hdr.process_status,
				 hdr.edi_test_indicator ';
Line: 230

                    ''CHANGE'', 7, ''DELETE'', 8),
                    hdr.creation_date';
Line: 247

                    ''CHANGE'', 7, ''DELETE'', 8),
                    hdr.creation_date';
Line: 252

     v_Statement  := v_select_clause || ' '
                     || v_from_clause || ' '
                     || v_where_clause
                     || v_order_clause;
Line: 258

        rlm_core_sv.dlog(C_DEBUG,'The select Statement is:
      ', v_Statement);
Line: 288

         RLM_FORECAST_SV.g_designator_tab.delete;
Line: 293

           update rlm_interface_headers_all
           set process_status = rlm_core_sv.k_PS_AVAILABLE
           where header_id = v_header_id;
Line: 298

              rlm_core_sv.dlog(C_DEBUG,' No of headers updated:', SQL%ROWCOUNT);
Line: 301

           update rlm_interface_lines
           set process_status = rlm_core_sv.k_PS_AVAILABLE,
               dsp_child_process_index = NULL
           where header_id = v_header_id
           and process_status = rlm_core_sv.k_PS_ERROR;
Line: 308

              rlm_core_sv.dlog(C_DEBUG,' No of lines updated:', SQL%ROWCOUNT);
Line: 312

           delete from rlm_demand_exceptions rde
           where rde.interface_header_id = v_header_id
           and (rde.interface_line_id in (select ril.line_id
                                           from rlm_interface_lines ril
                                          where ril.header_id = rde.interface_header_id)
                or exception_level = 'E'
                or message_name    = 'RLM_WARN_DROPPED_ITEMS'); --Bugfix 8844817
Line: 322

              rlm_core_sv.dlog(C_DEBUG,' No of demand exceptions lines deleted:', SQL%ROWCOUNT);
Line: 326

           update rlm_demand_exceptions
           set request_id = rlm_message_sv.g_conc_req_id
           where  interface_header_id = v_header_id;
Line: 345

           SELECT hsecs INTO l_val_start_time from v$timer;
Line: 347

           SELECT hsecs INTO l_val_end_time from v$timer;
Line: 363

             SELECT hsecs INTO l_post_start_time from v$timer;
Line: 365

             SELECT hsecs INTO l_post_end_time from v$timer;
Line: 414

           SELECT hsecs INTO l_comp_start_time from v$timer;
Line: 420

           SELECT hsecs INTO l_comp_end_time from v$timer;
Line: 452

               SELECT hsecs INTO l_start_child_time from v$timer;
Line: 461

               SELECT hsecs INTO l_end_child_time from v$timer;
Line: 465

               v_child_req_id.delete;
Line: 485

           UpdateHeaderPS(v_Sched_rec.header_id,
                          v_Sched_rec.schedule_header_id);
Line: 539

           UpdateGroupPS(v_Sched_rec.header_id,
                         v_Sched_rec.Schedule_header_id,
                         v_Group_rec,
                         rlm_core_sv.K_PS_PROCESSED,
                         'ALL');
Line: 545

           UpdateHeaderPS(v_Sched_rec.header_id,
                          v_Sched_rec.Schedule_header_id);
Line: 569

           UpdateGroupPS(v_header_id,
                         v_schedule_header_id,
                         v_Group_rec,
                          rlm_core_sv.k_PS_ERROR,
                         'ALL');
Line: 575

           UpdateHeaderPS(v_header_id,
                          v_schedule_header_id);
Line: 586

           UpdateGroupPS(v_Sched_rec.header_id,
                         v_Sched_rec.schedule_header_id,
                         v_Group_rec,
                         rlm_core_sv.k_PS_ERROR);
Line: 592

           UpdateHeaderPS(v_header_id, v_schedule_header_id);
Line: 623

           UpdateGroupPS(v_header_id,
                         v_schedule_header_id,
                         v_Group_rec,
                         rlm_core_sv.k_PS_ERROR,
                         'ALL');
Line: 629

           /* UpdateHeaderPS(v_header_id,
                          v_schedule_header_id); */
Line: 663

           UpdateGroupPS(v_header_id,
                             v_schedule_header_id,
                             v_Group_rec,
                             rlm_core_sv.k_PS_ERROR,
                             'ALL');
Line: 669

           UpdateHeaderPS(v_header_id,
                          v_schedule_header_id);
Line: 720

     SELECT hsecs INTO l_end_time from v$timer;
Line: 799

  select process_status into v_process_status
  from rlm_interface_headers
  where header_id = x_header_id;
Line: 803

  DELETE FROM RLM_INTERFACE_HEADERS
  WHERE header_id = x_header_id
  and  process_Status = rlm_core_sv.k_PS_PROCESSED;
Line: 809

    DELETE FROM RLM_INTERFACE_LINES
    WHERE header_id = x_header_id
    and  process_Status = rlm_core_sv.k_PS_PROCESSED;
Line: 815

    DELETE FROM RLM_INTERFACE_LINES
    WHERE header_id = x_header_id
    and  process_Status = rlm_core_sv.k_PS_PROCESSED
    and  item_detail_type <> rlm_rd_sv.k_MRP_FORECAST;
Line: 823

     rlm_core_sv.dlog(C_DEBUG, 'Lines deleted ', SQL%ROWCOUNT);
Line: 834

        rlm_core_sv.dlog(C_DEBUG, 'No records to delete' );
Line: 862

     SELECT   *
     FROM   rlm_interface_headers
     WHERE  header_id  = x_HeaderId
     and    process_status IN (rlm_core_sv.k_PS_AVAILABLE,
                               rlm_core_sv.k_PS_PARTIAL_PROCESSED)
     FOR UPDATE NOWAIT;
Line: 926

  PROCEDURE NAME:    UpdateGroupPS

===========================================================================*/

PROCEDURE UpdateGroupPS(x_header_id         IN     NUMBER,
                        x_ScheduleHeaderId  IN     NUMBER,
                        x_Group_rec         IN     rlm_dp_sv.t_Group_rec,
                        x_status            IN     NUMBER,
                        x_UpdateLevel       IN  VARCHAR2)
IS
  --
  v_Progress VARCHAR2(3) := '010';
Line: 943

  v_program_update_date    DATE:= sysdate;
Line: 948

     rlm_core_sv.dpush(C_SDEBUG, 'UpdateGroupPS');
Line: 949

     rlm_core_sv.dlog(C_DEBUG,'UpdateGroupStatus to ', x_status);
Line: 959

     rlm_core_sv.dlog(C_DEBUG,'x_UpdateLevel to ', x_UpdateLevel);
Line: 968

  SELECT schedule_header_id
  INTO  v_SchedHeaderId
  FROM rlm_interface_headers
  WHERE header_id = x_header_id;
Line: 977

  IF x_UpdateLevel  <> 'GROUP' THEN
     --
     UPDATE rlm_interface_lines
     SET    process_status = x_Status,
            LAST_UPDATE_LOGIN         = v_login_id ,
            REQUEST_ID                = v_request_id,
            PROGRAM_APPLICATION_ID    = v_program_app_id,
            PROGRAM_ID                = v_program_id,
            PROGRAM_UPDATE_DATE       = v_program_update_date
     WHERE  header_id  = x_header_id
     AND    process_status <> rlm_core_sv.k_PS_ERROR; -- bug 5134706
Line: 991

       rlm_core_sv.dlog(C_DEBUG,'No of interface Lines Updated ', SQL%ROWCOUNT);
Line: 994

     UPDATE rlm_schedule_lines sl
     SET    process_status = x_Status,
            LAST_UPDATE_LOGIN         = v_login_id ,
            REQUEST_ID                = v_request_id,
            PROGRAM_APPLICATION_ID    = v_program_app_id,
            PROGRAM_ID                = v_program_id,
            PROGRAM_UPDATE_DATE       = v_program_update_date
     WHERE  sl.header_id                 =  v_SchedHeaderId
     AND    process_status <> rlm_core_sv.k_PS_ERROR -- bug 5134706
     AND    interface_line_id in
            (SELECT line_id
             FROM rlm_interface_lines_all il
             WHERE il.header_id = x_header_id);
Line: 1009

        rlm_core_sv.dlog(C_DEBUG,'No of Schedule Lines Updated ', SQL%ROWCOUNT);
Line: 1015

        rlm_core_sv.dlog(C_DEBUG,'Update Group');
Line: 1020

     UPDATE rlm_schedule_lines sch
     SET    process_status = x_Status,
            LAST_UPDATE_LOGIN         = v_login_id ,
            REQUEST_ID                = v_request_id,
            PROGRAM_APPLICATION_ID    = v_program_app_id,
            PROGRAM_ID                = v_program_id,
            PROGRAM_UPDATE_DATE       = v_program_update_date
     WHERE  header_id  =  v_SchedHeaderId
     AND    interface_line_id in
            (SELECT /*+  unnest  */ line_id  --Bugfix 12863728
             FROM   rlm_interface_lines_all il
             WHERE  header_id  = x_header_id
             AND    industry_attribute15 = x_Group_rec.industry_attribute15
             AND    ship_to_org_id = x_Group_rec.ship_to_org_id
             AND    customer_item_id = x_Group_rec.customer_item_id
             AND    inventory_item_id = x_Group_rec.inventory_item_id
             AND    process_status  IN (rlm_core_sv.k_PS_AVAILABLE,
                                        rlm_core_sv.k_PS_PROCESSED,
                                        rlm_core_sv.k_PS_FROZEN_FIRM));
Line: 1041

        rlm_core_sv.dlog(C_DEBUG,'No of Schedule Lines Updated ', SQL%ROWCOUNT);
Line: 1044

     UPDATE rlm_interface_lines
     SET    process_status = x_Status,
            LAST_UPDATE_LOGIN         = v_login_id ,
            REQUEST_ID                = v_request_id,
            PROGRAM_APPLICATION_ID    = v_program_app_id,
            PROGRAM_ID                = v_program_id,
            PROGRAM_UPDATE_DATE       = v_program_update_date
     WHERE  header_id  = x_header_id
     AND    industry_attribute15 = x_Group_rec.industry_attribute15
     AND    ship_to_org_id = x_Group_rec.ship_to_org_id
     AND    customer_item_id = x_Group_rec.customer_item_id
     AND    inventory_item_id = x_Group_rec.inventory_item_id
     AND    process_status  IN (rlm_core_sv.k_PS_AVAILABLE,
                                rlm_core_sv.k_PS_PROCESSED,
                                rlm_core_sv.k_PS_FROZEN_FIRM);
Line: 1061

        rlm_core_sv.dlog(C_DEBUG,'No of interface Lines Updated ', SQL%ROWCOUNT);
Line: 1074

     rlm_message_sv.sql_error('rlm_dp_sv.UpdateGroupPS', v_Progress);
Line: 1082

END UpdateGroupPS;
Line: 1086

PROCEDURE NAME:       UpdateHeaderPS

===========================================================================*/

PROCEDURE UpdateHeaderPS (x_HeaderId    IN   NUMBER,
                          x_ScheduleHeaderId    IN   NUMBER)
IS
  --
  x_progress      VARCHAR2(3) := '010';
Line: 1107

     rlm_core_sv.dpush(C_SDEBUG,'UpdateHeaderPS');
Line: 1112

  SELECT schedule_header_id
  INTO  v_SchedHeaderId
  FROM rlm_interface_headers
  WHERE header_id = x_HeaderId;
Line: 1126

  SELECT count(*)
  INTO v_tot_recs
  FROM rlm_interface_lines
  WHERE header_id = x_HeaderId;
Line: 1135

  SELECT count(*)
  INTO v_error_recs
  FROM rlm_interface_lines
  WHERE header_id = x_HeaderId
  AND   process_status = rlm_core_sv.k_PS_ERROR;
Line: 1145

  SELECT count(*)
  INTO v_proc_recs
  FROM rlm_interface_lines
  WHERE header_id = x_HeaderId
  AND   process_status = rlm_core_sv.k_PS_PROCESSED;
Line: 1155

  SELECT COUNT(1)
  INTO v_proc_sch
  FROM rlm_schedule_lines
  WHERE process_status = rlm_core_sv.k_PS_PROCESSED
  AND header_id = v_SchedHeaderId;
Line: 1191

  UPDATE rlm_interface_headers
  SET    process_status            = x_HeaderStatus,
         LAST_UPDATE_LOGIN         = fnd_global.login_id ,
         REQUEST_ID                = RLM_MESSAGE_SV.g_conc_req_id ,
         PROGRAM_APPLICATION_ID    = fnd_global.PROG_APPL_ID ,
         PROGRAM_ID                = fnd_global.conc_program_id,
         PROGRAM_UPDATE_DATE       = sysdate
  WHERE  header_id  = x_HeaderId;
Line: 1202

     rlm_core_sv.dlog(C_DEBUG,'Number of Interface header updated',SQL%ROWCOUNT);
Line: 1205

  UPDATE rlm_schedule_headers
  SET    process_status            = x_HeaderStatus,
         LAST_UPDATE_LOGIN         = fnd_global.login_id ,
         REQUEST_ID                = RLM_MESSAGE_SV.g_conc_req_id ,
         PROGRAM_APPLICATION_ID    = fnd_global.PROG_APPL_ID ,
         PROGRAM_ID                = fnd_global.conc_program_id,
         PROGRAM_UPDATE_DATE       = sysdate
  WHERE  header_id  = v_SchedHeaderId ;
Line: 1215

     rlm_core_sv.dlog(C_DEBUG,'Number of schedule header updated',SQL%ROWCOUNT);
Line: 1230

    rlm_message_sv.sql_error('rlm_dp_sv.UpdateHeaderStatus', x_progress);
Line: 1236

END UpdateHeaderPS;
Line: 1270

  Select count(*)
  into x_errors
  from rlm_demand_exceptions
  where request_id = x_requestid
  and exception_level in ('E', 'W', 'I');
Line: 1380

  SELECT count(*) into v_Count
  FROM rlm_interface_lines
  WHERE  header_id  = x_header_id
  AND    industry_attribute15 = x_Group_rec.industry_attribute15
  AND    ship_to_org_id = x_Group_rec.ship_to_org_id
  AND    customer_item_id = x_Group_rec.customer_item_id
  AND    item_detail_type = rlm_rd_sv.k_MRP_FORECAST
  AND    process_status   = rlm_core_sv.k_PS_AVAILABLE;
Line: 1431

    SELECT   ril.order_header_id,
             ril.blanket_number
    FROM     rlm_interface_headers   rih,
             rlm_interface_lines_all ril
    WHERE    ril.header_id = x_header_id
    AND      ril.header_id = rih.header_id
    AND      ril.process_status in ( rlm_core_sv.k_PS_AVAILABLE,
                                     rlm_core_sv.k_PS_PARTIAL_PROCESSED)
    AND      rih.org_id = ril.org_id
    GROUP BY ril.order_header_id,ril.blanket_number ;
Line: 1470

    update rlm_interface_lines
    set    dsp_child_process_index = v_index
    where  header_id = x_header_id
    and    nvl(order_header_id,-99) = nvl(v_Group_rec.order_header_id,-99)
    and    nvl(blanket_number,-99) =  nvl(v_Group_rec.blanket_number,-99);
Line: 1616

     is completed before it can update the header.
     child request updates the interface lines after
     completing manage demand, forecast and rec demand */
  --
  FOR i IN x_child_req_id.FIRST..x_child_req_id.LAST LOOP
    --
    v_wait_status := fnd_concurrent.wait_for_request(
                                       x_child_req_id(i),
				       10,     -- check every 10 sec
				       10000,  -- timeout after 10000 sec
				       v_phase,
				       v_reqstatus,
				       v_devphase,
				       v_devstatus,
				       v_reqmessage);
Line: 1632

    update rlm_demand_exceptions
    set request_id = RLM_MESSAGE_SV.g_conc_req_id
    where request_id = x_child_req_id(i);
Line: 1636

    /* update group status for all lines with child req id*/
    --
    IF (l_debug <> -1) THEN
      rlm_core_sv.dlog(C_DEBUG,'child process index ', i);
Line: 1648

      update rlm_interface_lines
      set    process_status=    rlm_core_sv.k_PS_ERROR
      where  header_id = x_header_id
      and    dsp_child_process_index = i
      and    process_status <> rlm_core_sv.k_PS_PROCESSED;
Line: 1656

        rlm_core_sv.dlog(C_DEBUG,'No of interface Lines Updated', SQL%ROWCOUNT);
Line: 1659

      update rlm_schedule_lines sch
      set    process_status = rlm_core_sv.k_PS_ERROR
      where  interface_line_id in
           (select line_id
            from   rlm_interface_lines_all il
            where  header_id = x_header_id
            and    dsp_child_process_index = i
            and    process_status <> rlm_core_sv.k_PS_PROCESSED);
Line: 1669

       rlm_core_sv.dlog(C_DEBUG,'No of schedule Lines Updated ', SQL%ROWCOUNT);
Line: 1745

  SELECT *
  INTO   v_sched_rec
  FROM   rlm_interface_headers_all
  WHERE  header_id  = p_header_id
  AND    process_status IN (rlm_core_sv.k_PS_AVAILABLE,
                            rlm_core_sv.k_PS_PARTIAL_PROCESSED);
Line: 1756

   UpdateGroupPS(p_header_id,
                 null,
                 v_Group_rec,
                 rlm_core_sv.K_PS_ERROR,
                 'ALL');
Line: 1788

  update rlm_interface_lines
  set    process_status = rlm_core_sv.k_PS_ERROR
  where  header_id = p_header_id
  and    dsp_child_process_index = p_index;
Line: 1793

  update rlm_schedule_lines sch
  set    process_status = rlm_core_sv.k_PS_ERROR
  where  interface_line_id in
                        (select line_id
                         from   rlm_interface_lines_all il
                         where  header_id = p_header_id
                         and    dsp_child_process_index = p_index);
Line: 1850

    SELECT   rih.customer_id,
             ril.ship_from_org_id,
             ril.ship_to_address_id,
             ril.ship_to_site_use_id,
             ril.ship_to_org_id,
             ril.customer_item_id,
             ril.inventory_item_id,
             ril.industry_attribute15,
             ril.intrmd_ship_to_id,       --Bugfix 5911991
 	     ril.intmed_ship_to_org_id,   --Bugfix 5911991
             ril.order_header_id,
	     ril.blanket_number,
             min(ril.start_date_time),
             ril.ship_to_customer_id
    FROM     rlm_interface_headers   rih,
             rlm_interface_lines_all ril
    WHERE    ril.header_id = p_header_id
    AND      ril.header_id = rih.header_id
    AND      nvl(ril.dsp_child_process_index,-99) =nvl(p_index, -99)
    AND      ril.process_status in ( rlm_core_sv.k_PS_AVAILABLE,
                                     rlm_core_sv.k_PS_PARTIAL_PROCESSED)
    AND      rih.org_id = ril.org_id
    GROUP BY rih.customer_id,
             ril.ship_from_org_id,
             ril.ship_to_address_id,
             ril.ship_to_site_use_id,
             ril.ship_to_org_id,
             ril.customer_item_id,
             ril.inventory_item_id,
             ril.industry_attribute15,
             ril.intrmd_ship_to_id,       --Bugfix 5911991
	     ril.intmed_ship_to_org_id,   --Bugfix 5911991
             ril.order_header_id,
	     ril.blanket_number,
             ril.ship_to_customer_id
    ORDER BY min(ril.start_date_time),
             ril.ship_to_address_id,
             ril.customer_item_id;
Line: 1930

      SELECT hsecs INTO l_md_start_time from v$timer;
Line: 1945

      SELECT hsecs INTO l_md_end_time from v$timer;
Line: 1958

      SELECT hsecs INTO l_mf_start_time from v$timer;
Line: 1965

      SELECT hsecs INTO l_mf_end_time from v$timer;
Line: 1978

      SELECT hsecs INTO l_rd_start_time from v$timer;
Line: 1985

      SELECT hsecs INTO l_rd_end_time from v$timer;
Line: 1994

      UpdateGroupPS(v_Sched_rec.header_id,
                    v_Sched_rec.schedule_header_id,
                    v_Group_rec,
                    rlm_core_sv.k_PS_PROCESSED);
Line: 2025

       UpdateGroupPS(v_Sched_rec.header_id,
                     v_Sched_rec.schedule_header_id,
                     v_Group_rec,
                     rlm_core_sv.k_PS_ERROR);
Line: 2067

       UpdateGroupPS(v_Sched_rec.header_id,
                     v_Sched_rec.schedule_header_id,
                     v_Group_rec,
                     rlm_core_sv.k_PS_ERROR);
Line: 2108

       UpdateGroupPS(v_Sched_rec.header_id,
                     v_Sched_rec.schedule_header_id,
                     v_Group_rec,
                     rlm_core_sv.k_PS_ERROR);
Line: 2158

       UpdateGroupPS(v_Sched_rec.header_id,
                     v_Sched_rec.schedule_header_id,
                     v_Group_rec,
                     rlm_core_sv.k_PS_ERROR);