DBA Data[Home] [Help]

APPS.WIP_JOB_DTLS_VALIDATIONS SQL Statements

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

Line: 6

      select interface_id
        from wip_job_dtls_interface wjdi
       where wjdi.group_id = p_group_id
         and wjdi.parent_header_id = p_parent_header_id
         and wjdi.process_phase = wip_constants.ml_validation
         and wjdi.process_status in (wip_constants.running, wip_constants.warning)
         and not exists (select 1
                           from wip_job_schedule_interface wjsi
                          where wjdi.group_id = wjsi.group_id
                            and wjdi.parent_header_id = wjsi.header_id);
Line: 18

      select interface_id
        from wip_job_dtls_interface wjdi
       where wjdi.group_id = p_group_id
         and wjdi.process_phase = wip_constants.ml_validation
         and wjdi.process_status in (wip_constants.running,
                                     wip_constants.warning)
         and not exists (select 1
                           from wip_discrete_jobs wdj
                          where wjdi.wip_entity_id = wdj.wip_entity_id
                            and wjdi.organization_id = wdj.organization_id);
Line: 69

        update wip_job_dtls_interface wjdi
           set process_status = wip_constants.error
         where wjdi.group_id = p_group_id
           and process_phase = wip_constants.ml_validation
           and process_status in (wip_constants.running,
                                  wip_constants.warning)
           and not exists (select 1
                             from wip_discrete_jobs wdj
                            where wjdi.wip_entity_id = wdj.wip_entity_id
                              and wjdi.organization_id = wdj.organization_id);
Line: 80

        update wip_job_dtls_interface wjdi
           set process_status = wip_constants.error
         where group_id = p_group_id
           and parent_header_id = p_parent_header_id
           and process_phase = wip_constants.ml_validation
           and process_status in (wip_constants.running,
                                  wip_constants.warning)
           and not exists (select 1
                           from wip_job_schedule_interface wjsi
                          where wjsi.group_id = p_group_id
                            and wjdi.parent_header_id = wjsi.header_id);
Line: 98

      select interface_id
        from wip_job_dtls_interface wjdi
       where wjdi.group_id = p_group_id
         and wjdi.parent_header_id = p_parent_header_id
         and wjdi.process_phase = wip_constants.ml_validation
         and wjdi.process_status in (wip_constants.running,
                                     wip_constants.warning)
         and not exists (select 1
                           from wip_discrete_jobs wdj
                          where wjdi.wip_entity_id = wdj.wip_entity_id
                            and wjdi.organization_id = wdj.organization_id
                            and wdj.status_type in (wip_constants.unreleased,
                                                    wip_constants.released,
                                                    wip_constants.comp_chrg,
                                                    wip_constants.hold));
Line: 132

      update wip_job_dtls_interface wjdi
        set process_status = wip_constants.error
        where group_id = p_group_id
          and parent_header_id = p_parent_header_id
          and process_phase = wip_constants.ml_validation
          and process_status in (wip_constants.running,
                                 wip_constants.warning)
          and not exists (select 1
                            from wip_discrete_jobs wdj
                           where wjdi.wip_entity_id = wdj.wip_entity_id
                             and wjdi.organization_id = wdj.organization_id
                             and wdj.status_type in (wip_constants.unreleased,
                                                     wip_constants.released,
                                                     wip_constants.comp_chrg,
                                                     wip_constants.hold));
Line: 153

      select interface_id
        from wip_job_dtls_interface wjdi
       where wjdi.group_id = p_group_id
         and wjdi.parent_header_id = p_parent_header_id
         and wjdi.process_phase = wip_constants.ml_validation
         and wjdi.process_status in (wip_constants.running,
                                     wip_constants.warning)
         and exists (select 1
                       from wip_discrete_jobs wdj
                      where wjdi.wip_entity_id = wdj.wip_entity_id
                        and wjdi.organization_id = wdj.organization_id
                        and wdj.status_type in (wip_constants.unreleased,
                                                wip_constants.released,
                                                wip_constants.comp_chrg,
                                                wip_constants.hold)
                        and wdj.firm_planned_flag = wip_constants.yes);
Line: 185

      update wip_job_dtls_interface wjdi
         set process_status = wip_constants.error
       where group_id = p_group_id
         and parent_header_id = p_parent_header_id
         and process_phase = wip_constants.ml_validation
         and process_status in (wip_constants.running,
                                wip_constants.warning)
         and exists (select 1
                       from wip_discrete_jobs wdj
                      where wjdi.wip_entity_id = wdj.wip_entity_id
                        and wjdi.organization_id = wdj.organization_id
                        and wdj.status_type in (wip_constants.unreleased,
                                                wip_constants.released,
                                                wip_constants.comp_chrg,
                                                wip_constants.hold)
                        and wdj.firm_planned_flag = wip_constants.yes);
Line: 210

      select min(operation_seq_num)
        from wip_operations
       where organization_id = p_organization_id
         and wip_entity_id = p_wip_entity_id;
Line: 216

      select interface_id
        from wip_job_dtls_interface wjdi
       where wjdi.group_id = p_group_id
         and wjdi.parent_header_id = p_parent_header_id
         and wjdi.process_phase = wip_constants.ml_validation
         and wjdi.process_status in (wip_constants.running,
                                     wip_constants.warning)
         and (   wjdi.load_type in (wip_job_details.wip_resource,
                                    wip_job_details.wip_sub_res,
                                    wip_job_details.wip_res_usage)

              or (    wjdi.load_type = wip_job_details.wip_mtl_requirement
                  and wjdi.operation_seq_num <> 1
                 )
             )
         and not exists (select 1
                           from wip_operations wo
                          where wjdi.wip_entity_id = wo.wip_entity_id
                            and wjdi.organization_id = wo.organization_id
                            and wjdi.operation_seq_num = wo.operation_seq_num);
Line: 238

      select interface_id
        from wip_job_dtls_interface wjdi
       where wjdi.group_id = p_group_id
         and wjdi.process_phase = wip_constants.ml_validation
         and wjdi.process_status in (wip_constants.running,
                                     wip_constants.warning)
         and wjdi.wip_entity_id = p_wip_entity_id
         and wjdi.organization_id = p_organization_id
         and (   wjdi.load_type in (wip_job_details.wip_resource,
                                    wip_job_details.wip_sub_res,
                                    wip_job_details.wip_res_usage)

              or (    wjdi.load_type = wip_job_details.wip_mtl_requirement
                  and wjdi.operation_seq_num <> 1
                 )
             )
         and not exists (select 1
                           from wip_operations wo
                          where wjdi.wip_entity_id = wo.wip_entity_id
                            and wjdi.organization_id = wo.organization_id
                            and wjdi.operation_seq_num = wo.operation_seq_num);
Line: 269

    select count(*)
      into l_num_first_op_rows
      from wip_job_dtls_interface
     where group_id = p_group_id
       and parent_header_id = p_parent_header_id
       and process_phase = wip_constants.ml_validation
       and process_status in (wip_constants.running,wip_constants.warning)
       and wip_entity_id = p_wip_entity_id
       and organization_id = p_organization_id
       and load_type = wip_job_details.wip_mtl_requirement
       and substitution_type = wip_job_details.wip_add
       and operation_seq_num = 1;
Line: 290

        update wip_job_dtls_interface
           set operation_seq_num = l_first_op_seq_num
         where group_id = p_group_id
           and parent_header_id = p_parent_header_id
           and process_phase = wip_constants.ml_validation
           and process_status in (wip_constants.running, wip_constants.warning)
           and wip_entity_id = p_wip_entity_id
           and organization_id = p_organization_id
           and load_type = wip_job_details.wip_mtl_requirement
           and substitution_type = wip_job_details.wip_add
           and operation_seq_num = 1;
Line: 343

        update wip_job_dtls_interface wjdi
           set process_status = wip_constants.error
         where group_id = p_group_id
           and process_phase = wip_constants.ml_validation
           and process_status in (wip_constants.running,
                                  wip_constants.warning)
           and wip_entity_id = p_wip_entity_id
           and organization_id = p_organization_id
           and (   load_type in (wip_job_details.wip_resource,
                                 wip_job_details.wip_sub_res,
                                 wip_job_details.wip_res_usage)

                or (    load_type = wip_job_details.wip_mtl_requirement
                    and operation_seq_num <> 1
                   )
               )
           and not exists (select 1
                             from wip_operations wo
                            where wjdi.wip_entity_id = wo.wip_entity_id
                              and wjdi.organization_id = wo.organization_id
                              and wjdi.operation_seq_num = wo.operation_seq_num);
Line: 365

        update wip_job_dtls_interface wjdi
           set process_status = wip_constants.error
         where group_id = p_group_id
           and parent_header_id = p_parent_header_id
           and process_phase = wip_constants.ml_validation
           and process_status in (wip_constants.running,
                                  wip_constants.warning)
           and (   load_type in (wip_job_details.wip_resource,
                                 wip_job_details.wip_sub_res,
                                 wip_job_details.wip_res_usage)

                or (    load_type = wip_job_details.wip_mtl_requirement
                    and operation_seq_num <> 1
                   )
               )
           and not exists (select 1
                             from wip_operations wo
                            where wjdi.wip_entity_id = wo.wip_entity_id
                              and wjdi.organization_id = wo.organization_id
                              and wjdi.operation_seq_num = wo.operation_seq_num);
Line: 395

      select interface_id
        from wip_job_dtls_interface wjdi
       where wjdi.group_id = p_group_id
         and wjdi.parent_header_id = p_parent_header_id
         and wjdi.process_phase = wip_constants.ml_validation
         and wjdi.process_status in (wip_constants.running,
                                     wip_constants.warning)
         and wjdi.wip_entity_id = p_wip_entity_id
         and wjdi.organization_id = p_organization_id
         and (   wjdi.load_type not in (1, 2, 3, 4, 5, 6, 7, WIP_JOB_DETAILS.WIP_RES_INSTANCE, WIP_JOB_DETAILS.WIP_RES_INSTANCE_USAGE)     -- load_type must be resource or material


              or wjdi.substitution_type not in (1, 2, 3)); -- substitution_type must be delete or add or change
Line: 428

      update wip_job_dtls_interface
         set process_status = wip_constants.error
       where group_id = p_group_id
         and parent_header_id = p_parent_header_id
         and process_phase = wip_constants.ml_validation
         and process_status in (wip_constants.running,
                                wip_constants.warning)
         and wip_entity_id = p_wip_entity_id
         and organization_id = p_organization_id
         and (   load_type not in (1, 2, 3, 4, 5)
              or substitution_type not in (1, 2, 3));
Line: 443

  procedure last_updated_by(p_group_id        IN  number,
                            p_parent_header_id IN number,
                            p_wip_entity_id   IN  number,
                            p_organization_id IN  number) IS

    cursor c_invalid_rows is
      select interface_id
        from wip_job_dtls_interface wjdi
       where wjdi.group_id = p_group_id
         and wjdi.parent_header_id = p_parent_header_id
         and wjdi.process_phase = wip_constants.ml_validation
         and wjdi.process_status in (wip_constants.running,
                                     wip_constants.warning)
         and wjdi.wip_entity_id = p_wip_entity_id
         and wjdi.organization_id = p_organization_id
         and not exists (select 1
                           from fnd_user_view fu
                          where fu.user_id = wjdi.last_updated_by
                            and sysdate between fu.start_date and nvl(fu.end_date,sysdate+1));
Line: 469

      fnd_message.set_name('WIP', 'WIP_ML_LAST_UPDATED_BY');
Line: 483

      update wip_job_dtls_interface wjdi
         set process_status = wip_constants.error
       where group_id = p_group_id
         and parent_header_id = p_parent_header_id
         and process_phase = wip_constants.ml_validation
         and process_status in (wip_constants.running,
                                wip_constants.warning)
         and wip_entity_id = p_wip_entity_id
         and organization_id = p_organization_id
         and not exists (select 1
                           from fnd_user_view fu
                          where fu.user_id = wjdi.last_updated_by
                            and sysdate between fu.start_date and nvl(fu.end_date,sysdate+1));
Line: 497

  end last_updated_by;
Line: 504

      select interface_id
        from wip_job_dtls_interface wjdi
       where wjdi.group_id = p_group_id
         and wjdi.parent_header_id = p_parent_header_id
         and wjdi.process_phase = wip_constants.ml_validation
         and wjdi.process_status in (wip_constants.running,
                                     wip_constants.warning)
         and wjdi.wip_entity_id = p_wip_entity_id
         and wjdi.organization_id = p_organization_id
         and not exists (select 1
                           from fnd_user_view fu
                          where fu.user_id = wjdi.created_by
                            and sysdate between fu.start_date and nvl(fu.end_date,sysdate+1));
Line: 538

      update wip_job_dtls_interface wjdi
         set process_status = wip_constants.error
       where group_id = p_group_id
         and parent_header_id = p_parent_header_id
         and process_phase = wip_constants.ml_validation
         and process_status in (wip_constants.running,
                                      wip_constants.warning)
          and wip_entity_id = p_wip_entity_id
          and organization_id = p_organization_id
          and not exists (select 1
                            from fnd_user_view fu
                           where fu.user_id = wjdi.created_by
                             and sysdate between fu.start_date and nvl(fu.end_date,sysdate+1));
Line: 564

      select interface_id
        from wip_job_dtls_interface wjdi
       where wjdi.group_id = p_group_id
         and wjdi.parent_header_id = p_parent_header_id
         and wjdi.process_phase = wip_constants.ml_validation
         and wjdi.process_status in (wip_constants.running,
                                     wip_constants.warning)
         and wjdi.wip_entity_id = p_wip_entity_id
         and wjdi.organization_id = p_organization_id
         and exists (select 1
                       from wip_job_dtls_interface wjdi2
                      where wjdi2.group_id = wjdi.group_id
                        and wjdi2.parent_header_id = wjdi.parent_header_id
                        and wjdi2.process_status = wip_constants.error
                        and wjdi2.wip_entity_id = wjdi.wip_entity_id
                        and wjdi2.organization_id = wjdi.organization_id);
Line: 591

      update wip_job_dtls_interface wjdi
         set process_status = wip_constants.error
       where group_id = p_group_id
         and parent_header_id = p_parent_header_id
         and process_phase = wip_constants.ml_validation
         and process_status in (wip_constants.running,
                                wip_constants.warning)
         and wip_entity_id = p_wip_entity_id
         and organization_id = p_organization_id
         and exists (select 1
                       from wip_job_dtls_interface wjdi2
                      where wjdi2.group_id = wjdi.group_id
                        and wjdi2.parent_header_id = wjdi.parent_header_id
                        and wjdi2.process_status = wip_constants.error
                        and wjdi2.wip_entity_id = wjdi.wip_entity_id
                        and wjdi2.organization_id = wjdi.organization_id);