DBA Data[Home] [Help]

APPS.AHL_PRD_WO_LOGIN_PVT SQL Statements

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

Line: 105

    SELECT AW.workorder_name
    FROM AHL_WORKORDERS AW
    WHERE AW.WORKORDER_ID = p_workorder_id;
Line: 425

  SELECT workorder_id
  FROM AHL_WORKORDERS AWOS, WIP_DISCRETE_JOBS WIP,
       ORG_ORGANIZATION_DEFINITIONS ORG
  WHERE AWOS.WIP_ENTITY_ID = WIP.WIP_ENTITY_ID
    AND AWOS.WORKORDER_NAME = p_workorder_name
    AND WIP.ORGANIZATION_ID = ORG.ORGANIZATION_ID
    AND ORG.ORGANIZATION_CODE = p_org_code;
Line: 486

      SELECT AWO.STATUS_CODE
      FROM AHL_WORKORDER_OPERATIONS AWO
      WHERE AWO.WORKORDER_ID = p_workorder_id
        AND AWO.operation_sequence_num = p_operation_seq_num
      FOR UPDATE OF AWO.object_version_number;
Line: 501

    SELECT AOR.OPERATION_RESOURCE_ID, WOR.start_date, WOR.completion_date,
           (select wo1.department_id from wip_operations wo1
            where wo1.wip_entity_id = aw.wip_entity_id
            and wo1.operation_seq_num = p_operation_seq_num) department_id,
           WOR.resource_seq_num
    FROM WIP_OPERATION_RESOURCES WOR,
         AHL_OPERATION_RESOURCES AOR, AHL_WORKORDER_OPERATIONS AWO, AHL_WORKORDERS AW,
         BOM_RESOURCES BRS
    WHERE AW.workorder_id = AWO.workorder_id
      AND WOR.wip_entity_id = AW.wip_entity_id
      AND WOR.RESOURCE_SEQ_NUM = AOR.RESOURCE_SEQUENCE_NUM
      AND WOR.OPERATION_SEQ_NUM = AWO.OPERATION_SEQUENCE_NUM
      AND AWO.operation_sequence_num = p_operation_seq_num
      AND AWO.workorder_operation_id = AOR.workorder_operation_id
      AND WOR.organization_id = BRS.organization_id
      AND WOR.resource_id = AOR.resource_id
      AND WOR.resource_id = BRS.resource_id
      --AND WOR.operation_seq_num = p_operation_seq_num
      AND BRS.resource_type = 2  -- person.
      AND AW.workorder_id = p_workorder_id
      AND WOR.resource_id = nvl(p_resource_id, WOR.resource_id)
      AND WOR.resource_seq_num = nvl(p_resource_seq_num, WOR.resource_seq_num)
      -- qualified.
      AND EXISTS (SELECT 'x'
                  FROM mtl_employees_current_view pf,
                       bom_resource_employees bre,
                       bom_dept_res_instances bdri,
                       wip_operations wo,
                       bom_department_resources bdr
                 WHERE WO.wip_entity_id = AW.wip_entity_id
                   AND WO.operation_seq_num = AWO.operation_sequence_num
                   -- AND WO.department_id = bdri.department_id
                   AND nvl(bdr.share_from_dept_id,WO.department_id) = bdri.department_id
                   AND bdr.department_id = wo.department_id
                   AND bdr.resource_id = WOR.RESOURCE_ID
                   AND WOR.RESOURCE_ID= bdri.resource_id
                   AND bre.instance_id = bdri.instance_id
                   AND bre.resource_id = bdri.resource_id
                   AND bre.organization_id = WOR.organization_id
                   AND bre.person_id = pf.employee_id
                   AND pf.organization_id = bre.organization_id
                   AND bre.person_id = p_employee_id);
Line: 547

    SELECT AWAS.Assignment_id, AWAS.object_version_number
    FROM AHL_WORK_ASSIGNMENTS AWAS
    WHERE AWAS.operation_resource_id = p_operation_resource_id
      AND AWAS.employee_id = p_employee_id;
Line: 792

                     'Inserting into ahl_work_login_times.');
Line: 796

  insert into ahl_work_login_times(
                    work_login_time_id,
                    workorder_id,
                    operation_seq_num,
                    resource_seq_num,
                    operation_resource_id,
                    employee_id,
                    login_date,
                    object_version_number,
                    login_level,
                    LAST_UPDATE_DATE,
                    LAST_UPDATED_BY,
                    CREATION_DATE,
                    CREATED_BY,
                    LAST_UPDATE_LOGIN)
          values (
                    ahl_work_login_times_s.nextval,
                    p_workorder_id,
                    p_operation_seq_num,
                    p_resource_seq_num,
                    l_operation_resource_id,
                    p_employee_id,
                    sysdate,
                    1,
                    'R',
                    sysdate,
                    fnd_global.user_id,
                    sysdate,
                    fnd_global.user_id,
                    fnd_global.login_id
                 );
Line: 851

      SELECT AWO.STATUS_CODE
      FROM AHL_WORKORDER_OPERATIONS AWO
      WHERE AWO.WORKORDER_ID = p_workorder_id
        AND AWO.operation_sequence_num = p_operation_seq_num
      FOR UPDATE OF AWO.object_version_number;
Line: 863

    SELECT AOR.OPERATION_RESOURCE_ID, WOR.resource_seq_num, WOR.resource_id,
           WOR.start_date, WOR.completion_date,
           (select wo1.department_id from wip_operations wo1
            where wo1.wip_entity_id = aw.wip_entity_id
                  and wo1.operation_seq_num = p_operation_seq_num) department_id
    FROM WIP_OPERATION_RESOURCES WOR,
         AHL_OPERATION_RESOURCES AOR, AHL_WORKORDER_OPERATIONS AWO, AHL_WORKORDERS AW,
         BOM_RESOURCES BRS
    WHERE AW.workorder_id = AWO.workorder_id
      AND AWO.operation_sequence_num = p_operation_seq_num
      AND WOR.wip_entity_id = AW.wip_entity_id
      AND WOR.RESOURCE_SEQ_NUM = AOR.RESOURCE_SEQUENCE_NUM
      AND WOR.OPERATION_SEQ_NUM = AWO.OPERATION_SEQUENCE_NUM
      AND AWO.workorder_operation_id = AOR.workorder_operation_id
      AND WOR.organization_id = BRS.organization_id
      AND WOR.resource_id = AOR.resource_id
      AND WOR.resource_id = BRS.resource_id
      --AND WOR.operation_seq_num = p_operation_seq_num
      AND BRS.resource_type = 2  -- person.
      AND AW.workorder_id = p_workorder_id
      -- qualified.
      AND EXISTS (SELECT 'x'
                  FROM mtl_employees_current_view pf,
                       bom_resource_employees bre,
                       bom_dept_res_instances bdri,
                       wip_operations wo,
                       bom_department_resources bdr
                 WHERE WO.wip_entity_id = AW.wip_entity_id
                   AND WO.operation_seq_num = AWO.operation_sequence_num
                   --AND WO.department_id = bdri.department_id
                   AND nvl(bdr.share_from_dept_id,WO.department_id) = bdri.department_id
                   AND bdr.department_id = wo.department_id
                   AND bdr.resource_id = WOR.RESOURCE_ID
                   AND WOR.RESOURCE_ID= bdri.resource_id
                   AND bre.instance_id = bdri.instance_id
                   AND bre.resource_id = bdri.resource_id
                   AND bre.organization_id = WOR.organization_id
                   AND bre.person_id = pf.employee_id
                   AND pf.organization_id = bre.organization_id
                   AND bre.person_id = p_employee_id);
Line: 907

    SELECT AWAS.Assignment_id, AWAS.object_version_number
    FROM AHL_WORK_ASSIGNMENTS AWAS
    WHERE AWAS.operation_resource_id = p_operation_resource_id
      AND AWAS.employee_id = p_employee_id;
Line: 1115

              'Before inserting into ahl_work_login_times');
Line: 1117

  insert into ahl_work_login_times(
          work_login_time_id,
          workorder_id,
          operation_seq_num,
          resource_seq_num,
          operation_resource_id,
          employee_id,
          login_date,
          login_level,
          object_version_number,
          LAST_UPDATE_DATE,
          LAST_UPDATED_BY,
          CREATION_DATE,
          CREATED_BY,
          LAST_UPDATE_LOGIN)
  values (
          ahl_work_login_times_s.nextval,
          p_workorder_id,
          p_operation_seq_num,
          null,
          null,
          p_employee_id,
          sysdate,
          1,
          'O',
          sysdate,
          fnd_global.user_id,
          sysdate,
          fnd_global.user_id,
          fnd_global.login_id);
Line: 1168

    SELECT AW.STATUS_CODE
    FROM AHL_WORKORDERS AW
    WHERE AW.WORKORDER_ID = p_workorder_id
    FOR UPDATE OF AW.object_version_number;
Line: 1175

      SELECT AWO.STATUS_CODE
      FROM AHL_WORKORDER_OPERATIONS AWO
      WHERE AWO.WORKORDER_ID = p_workorder_id
    FOR UPDATE OF AWO.object_version_number;
Line: 1186

    SELECT AOR.OPERATION_RESOURCE_ID, WOR.operation_seq_num, WOR.resource_id,
           WOR.resource_seq_num, WOR.start_date, WOR.completion_date,
           (select wo1.department_id from wip_operations wo1
            where wo1.wip_entity_id = aw.wip_entity_id
                  and wo1.operation_seq_num = AWO.operation_sequence_num) department_id
    FROM WIP_OPERATION_RESOURCES WOR,
         AHL_OPERATION_RESOURCES AOR, AHL_WORKORDER_OPERATIONS AWO, AHL_WORKORDERS AW,
         BOM_RESOURCES BRS
    WHERE AW.workorder_id = AWO.workorder_id
      AND WOR.wip_entity_id = AW.wip_entity_id
      AND WOR.RESOURCE_SEQ_NUM = AOR.RESOURCE_SEQUENCE_NUM
      AND WOR.OPERATION_SEQ_NUM = AWO.OPERATION_SEQUENCE_NUM
      AND AWO.workorder_operation_id = AOR.workorder_operation_id
      AND WOR.resource_id = AOR.resource_id
      AND WOR.organization_id = BRS.organization_id
      AND WOR.resource_id = BRS.resource_id
      AND BRS.resource_type = 2  -- person.
      AND AW.workorder_id = p_workorder_id
      -- qualified.
      AND EXISTS (SELECT 'x'
                  FROM mtl_employees_current_view pf,
                       bom_resource_employees bre,
                       bom_dept_res_instances bdri,
                       wip_operations wo,
                       bom_department_resources bdr
                 WHERE WO.wip_entity_id = AW.wip_entity_id
                   AND WO.operation_seq_num = AWO.operation_sequence_num
                   --AND WO.department_id = bdri.department_id
                   AND nvl(bdr.share_from_dept_id,WO.department_id) = bdri.department_id
                   AND bdr.department_id = wo.department_id
                   AND bdr.resource_id = WOR.RESOURCE_ID
                   AND WOR.RESOURCE_ID= bdri.resource_id
                   AND bre.instance_id = bdri.instance_id
                   AND bre.resource_id = bdri.resource_id
                   AND bre.organization_id = WOR.organization_id
                   AND bre.person_id = pf.employee_id
                   AND pf.organization_id = bre.organization_id
                   AND bre.person_id = p_employee_id);
Line: 1228

    SELECT AWAS.Assignment_id, AWAS.object_version_number
    FROM AHL_WORK_ASSIGNMENTS AWAS
    WHERE AWAS.operation_resource_id = p_operation_resource_id
      AND AWAS.employee_id = p_employee_id;
Line: 1405

                 'Before inserting into ahl_work_login_times');
Line: 1409

  insert into ahl_work_login_times(
              work_login_time_id,
              workorder_id,
              operation_seq_num,
              resource_seq_num,
              operation_resource_id,
              employee_id,
              login_date,
              object_version_number,
              login_level,
              LAST_UPDATE_DATE,
              LAST_UPDATED_BY,
              CREATION_DATE,
              CREATED_BY,
              LAST_UPDATE_LOGIN)
  values (
              ahl_work_login_times_s.nextval,
              p_workorder_id,
              null,
              null,
              null,
              p_employee_id,
              sysdate,
              1,
              'W',
              sysdate,
              fnd_global.user_id,
              sysdate,
              fnd_global.user_id,
              fnd_global.login_id);
Line: 1727

      SELECT WLGN.workorder_id,
             AW.workorder_name,
             AW.wip_entity_id,
             WLGN.operation_seq_num,
             AOR.resource_id,
             WLGN.resource_seq_num,
             WLGN.login_level,
             WLGN.login_date,
             WLGN.work_login_time_id,
             WLGN.object_version_number
      FROM AHL_Operation_Resources AOR, AHL_WORKORDERS AW,
           AHL_WORK_LOGIN_TIMES WLGN
      WHERE WLGN.workorder_id(+) = AW.workorder_id
        AND WLGN.operation_resource_id = AOR.operation_resource_id(+)
        AND WLGN.employee_id(+) = c_employee_id
        AND WLGN.login_date(+) IS NOT NULL
        AND WLGN.logout_date(+) IS NULL --   employee logged in.
        AND AW.workorder_id = c_workorder_id
      FOR UPDATE OF WLGN.logout_date NOWAIT;
Line: 1749

    SELECT AW.STATUS_CODE, AW.workorder_name
    FROM AHL_WORKORDERS AW
    WHERE AW.WORKORDER_ID = p_workorder_id
    FOR UPDATE OF AW.object_version_number;
Line: 1756

      SELECT AWO.STATUS_CODE
      FROM AHL_WORKORDER_OPERATIONS AWO
      WHERE AWO.WORKORDER_ID = p_workorder_id
    FOR UPDATE OF AWO.object_version_number;
Line: 1764

      SELECT AWO.STATUS_CODE
      FROM AHL_WORKORDER_OPERATIONS AWO
      WHERE AWO.WORKORDER_ID = p_workorder_id
        AND AWO.operation_sequence_num = p_operation_seq_num
      FOR UPDATE OF AWO.object_version_number;
Line: 1776

    SELECT WOR.operation_seq_num, WOR.resource_id,
           WOR.resource_seq_num, BRS.unit_of_measure uom_code,
           WO.organization_id, WO.department_id
    FROM wip_operations wo,
         wip_operation_resources WOR,
         bom_resources BRS
    WHERE wo.wip_entity_id = WOR.wip_entity_id
      AND wo.operation_seq_num = WOR.operation_seq_num
      AND WOR.resource_id = BRS.resource_id
      AND BRS.resource_type = 2  -- person.
      AND wo.wip_entity_id = p_wip_entity_id
      AND exists ( SELECT 'x'
                   FROM bom_resource_employees bre,
                        bom_dept_res_instances bdri,
                        bom_department_resources bdr
                   WHERE --WO.department_id = bdri.department_id
                         nvl(bdr.share_from_dept_id, WO.department_id) = bdri.department_id
                     AND bdr.department_id = WO.department_id
                     AND bdr.resource_id = WOR.RESOURCE_ID
                     AND bre.resource_id = WOR.RESOURCE_ID
                     AND bre.instance_id = bdri.instance_id
                     AND bre.resource_id = bdri.resource_id
                     AND bre.person_id = p_employee_id);
Line: 1806

    SELECT WOR.operation_seq_num, WOR.resource_id,
           WOR.resource_seq_num, BRS.unit_of_measure uom_code,
           WO.organization_id, WO.department_id
    FROM wip_operations wo,
         wip_operation_resources WOR,
         bom_resources BRS
    WHERE wo.wip_entity_id = WOR.wip_entity_id
      AND wo.operation_seq_num = WOR.operation_seq_num
      AND WOR.resource_id = BRS.resource_id
      AND BRS.resource_type = 2  -- person.
      AND wo.wip_entity_id = p_wip_entity_id
      AND wo.operation_seq_num = p_operation_seq_num
      AND exists ( SELECT 'x'
                   FROM bom_resource_employees bre,
                        bom_dept_res_instances bdri,
                        bom_department_resources bdr
                   WHERE --WO.department_id = bdri.department_id
                     nvl(bdr.share_from_dept_id, WO.department_id) = bdri.department_id
                     AND bdr.department_id = WO.department_id
                     AND bdr.resource_id = WOR.RESOURCE_ID
                     AND bre.resource_id = WOR.RESOURCE_ID
                     AND bre.instance_id = bdri.instance_id
                     AND bre.resource_id = bdri.resource_id
                     AND bre.person_id = p_employee_id);
Line: 1838

    SELECT WOR.operation_seq_num, WOR.resource_id,
           WOR.resource_seq_num, BRS.unit_of_measure uom_code,
           WO.organization_id, WO.department_id
    FROM wip_operations wo,
         wip_operation_resources WOR,
         bom_resources BRS
    WHERE wo.wip_entity_id = WOR.wip_entity_id
      AND wo.operation_seq_num = WOR.operation_seq_num
      AND WOR.resource_id = BRS.resource_id
      AND BRS.resource_type = 2  -- person.
      AND wo.wip_entity_id = p_wip_entity_id
      AND wo.operation_seq_num = p_operation_seq_num
      AND WOR.resource_seq_num = p_resource_seq_num
      AND exists ( SELECT 'x'
                   FROM bom_resource_employees bre,
                        bom_dept_res_instances bdri,
                        bom_department_resources bdr
                   WHERE --WO.department_id = bdri.department_id
                     nvl(bdr.share_from_dept_id, WO.department_id) = bdri.department_id
                     AND bdr.department_id = WO.department_id
                     AND bdr.resource_id = WOR.RESOURCE_ID
                     AND bre.resource_id = WOR.RESOURCE_ID
                     AND bre.instance_id = bdri.instance_id
                     AND bre.resource_id = bdri.resource_id
                     AND bre.person_id = p_employee_id);
Line: 1867

    SELECT WOR.operation_seq_num, WOR.resource_id,
           WOR.resource_seq_num, BRS.unit_of_measure uom_code
    FROM wip_operations wo,
         wip_operation_resources WOR,
         bom_resources BRS
    WHERE wo.wip_entity_id = WOR.wip_entity_id
      AND wo.operation_seq_num = WOR.operation_seq_num
      AND WOR.resource_id = BRS.resource_id
      AND BRS.resource_type = 2  -- person.
      AND wo.wip_entity_id = p_wip_entity_id;
Line: 1881

    SELECT WOR.operation_seq_num, WOR.resource_id,
           WOR.resource_seq_num, BRS.unit_of_measure uom_code
    FROM wip_operations wo,
         wip_operation_resources WOR,
         bom_resources BRS
    WHERE wo.wip_entity_id = WOR.wip_entity_id
      AND wo.operation_seq_num = WOR.operation_seq_num
      AND WOR.resource_id = BRS.resource_id
      AND BRS.resource_type = 2  -- person.
      AND wo.wip_entity_id = p_wip_entity_id
      AND wo.operation_seq_num = p_operation_seq_num;
Line: 1897

    SELECT WOR.operation_seq_num, WOR.resource_id,
           WOR.resource_seq_num, BRS.unit_of_measure uom_code
    FROM wip_operations wo,
         wip_operation_resources WOR,
         bom_resources BRS
    WHERE wo.wip_entity_id = WOR.wip_entity_id
      AND wo.operation_seq_num = WOR.operation_seq_num
      AND WOR.resource_id = BRS.resource_id
      AND BRS.resource_type = 2  -- person.
      AND wo.wip_entity_id = p_wip_entity_id
      AND wo.operation_seq_num = p_operation_seq_num
      AND WOR.resource_seq_num = p_resource_seq_num;
Line: 1914

    SELECT WOR.resource_seq_num
    FROM   WIP_OPERATION_RESOURCES WOR
    WHERE  WOR.wip_entity_id = p_wip_entity_id
      AND  WOR.operation_seq_num = p_operation_seq_num
      AND  WOR.resource_id = p_resource_id;
Line: 2302

  UPDATE ahl_work_login_times
     SET logout_date = sysdate,
         object_version_number = l_object_version_number + 1
  WHERE work_login_time_id = l_work_login_time_id;
Line: 2392

    SELECT employee_id
    FROM FND_USER
    WHERE USER_ID = p_user_id;
Line: 2398

    SELECT employee_id
    FROM MTL_EMPLOYEES_CURRENT_VIEW
    WHERE employee_num = p_employee_number
      AND rownum < 2;
Line: 2474

      SELECT WLGN.workorder_id,
             AW.workorder_name,
             WLGN.operation_seq_num,
             AOR.resource_id,
             WLGN.resource_seq_num
      FROM AHL_Operation_Resources AOR, AHL_WORKORDERS AW,
           AHL_WORK_LOGIN_TIMES WLGN
      WHERE WLGN.workorder_id = AW.workorder_id
        AND WLGN.operation_resource_id = AOR.operation_resource_id(+)
        AND WLGN.employee_id = c_employee_id
        AND WLGN.logout_date IS NULL;   --   employee logged in.
Line: 2488

      SELECT full_name
      FROM MTL_EMPLOYEES_CURRENT_VIEW
      WHERE employee_id = p_employee_id
        AND rownum < 2;
Line: 2644

    SELECT wo.STATUS_CODE, wo.workorder_name, wo.wip_entity_id, we.organization_id
    FROM AHL_WORKORDERS WO, WIP_ENTITIES WE
    WHERE WO.wip_entity_id = we.wip_entity_id
      AND WORKORDER_ID = p_workorder_id;
Line: 2652

    SELECT pf.employee_id
    FROM  mtl_employees_current_view pf
    WHERE pf.employee_id = p_employee_id
      AND pf.organization_id = p_org_id;
Line: 2661

    SELECT 'x'
    FROM wip_operations wo
      WHERE wo.wip_entity_id = p_wip_entity_id
      AND not exists ( SELECT 'x'
                       FROM  wip_operation_resources WOR,
                             bom_resources BRS,
                             bom_resource_employees bre,
                             bom_dept_res_instances bdri
                       WHERE wo.operation_seq_num = WOR.operation_seq_num
                         AND WOR.resource_id = BRS.resource_id
                         AND BRS.resource_type = 2  -- person.
                         AND WO.department_id = bdri.department_id
                         AND WOR.RESOURCE_ID= bdri.resource_id
                         AND bre.instance_id = bdri.instance_id
                         AND bre.resource_id = bdri.resource_id
                         AND bre.person_id = p_employee_id);
Line: 2681

    SELECT 'x'
    FROM WIP_OPERATIONS WO
    WHERE wip_entity_id = p_wip_entity_id
      AND exists ( SELECT 'x'
                   FROM WIP_OPERATION_RESOURCES WOR, BOM_RESOURCES BRS
                   WHERE WOR.wip_entity_id = WO.wip_entity_id
                     AND WOR.operation_seq_num = WO.operation_seq_num
                     AND WOR.resource_id = BRS.resource_id
                     AND BRS.resource_type = 2  -- person.
                     );
Line: 2696

    SELECT 'x'
    FROM wip_operations wo,
         wip_operation_resources WOR,
         bom_resources BRS
    WHERE wo.wip_entity_id = WOR.wip_entity_id
      AND wo.operation_seq_num = WOR.operation_seq_num
      AND WOR.resource_id = BRS.resource_id
      AND BRS.resource_type = 2  -- person.
      AND wo.wip_entity_id = p_wip_entity_id
      AND exists ( SELECT 'x'
                   FROM bom_resource_employees bre,
                           bom_dept_res_instances bdri
                   WHERE WO.department_id = bdri.department_id
                     AND WOR.RESOURCE_ID= bdri.resource_id
                     AND bre.instance_id = bdri.instance_id
                     AND bre.resource_id = bdri.resource_id
                     AND bre.person_id = p_employee_id)
    GROUP BY WO.wip_entity_id, WO.Operation_seq_num
    HAVING count(WOR.resource_seq_num) > 1;
Line: 2720

    SELECT 'x'
    FROM wip_operations wo,
         wip_operation_resources WOR,
         bom_resources BRS
    WHERE wo.wip_entity_id = WOR.wip_entity_id
      AND wo.operation_seq_num = WOR.operation_seq_num
      AND WOR.resource_id = BRS.resource_id
      AND BRS.resource_type = 2  -- person.
      AND wo.wip_entity_id = p_wip_entity_id
      AND wo.operation_seq_num = p_operation_seq_num
      AND exists ( SELECT 'x'
                   FROM bom_resource_employees bre,
                           bom_dept_res_instances bdri
                   WHERE WO.department_id = bdri.department_id
                     AND WOR.RESOURCE_ID= bdri.resource_id
                     AND bre.instance_id = bdri.instance_id
                     AND bre.resource_id = bdri.resource_id
                     AND bre.person_id = p_employee_id)
    GROUP BY WO.wip_entity_id, WO.Operation_seq_num
    HAVING count(WOR.resource_seq_num) > 1;
Line: 2748

  SELECT 'x' -- status_code
  FROM AHL_WORKORDER_OPERATIONS
  WHERE WORKORDER_ID = p_workorder_id
  AND OPERATION_SEQUENCE_NUM = p_op_seq_num
  AND status_code = 2  -- uncomplete
  AND exists ( SELECT 'x'
               FROM wip_operation_resources WOR, bom_resources BRS
               WHERE WOR.wip_entity_id = p_wip_entity_id
                AND WOR.operation_seq_num = p_op_seq_num
                AND WOR.resource_id = BRS.resource_id
                AND BRS.resource_type = 2  -- person.
             );
Line: 2766

    SELECT 'x'
    FROM wip_operations wo
      WHERE wo.wip_entity_id = p_wip_entity_id
      and wo.operation_seq_num = p_operation_seq_num
      AND exists ( SELECT 'x'
                   FROM  wip_operation_resources WOR,
                         bom_resources BRS,
                         bom_resource_employees bre,
                         bom_dept_res_instances bdri,
                         bom_department_resources bdr
                   WHERE WOR.operation_seq_num = wo.operation_seq_num
                     AND WOR.wip_entity_id = wo.wip_entity_id
                     AND WOR.resource_id = BRS.resource_id
                     AND wor.organization_id = brs.organization_id
                     AND BRS.resource_type = 2  -- person.
                     AND brs.resource_id = bre.resource_id
                     AND brs.organization_id = bre.organization_id
                     --AND WO.department_id = bdri.department_id
                     AND nvl(bdr.share_from_dept_id, WO.department_id) = bdri.department_id
                     AND bdr.department_id = WO.department_id
                     AND bdr.resource_id = WOR.RESOURCE_ID
                     AND WOR.RESOURCE_ID= bdri.resource_id
                     AND bre.instance_id = bdri.instance_id
                     AND bre.resource_id = bdri.resource_id
                     AND bre.person_id = p_employee_id);
Line: 2799

    SELECT 'x'
    FROM wip_operations wo,
         wip_operation_resources WOR
    WHERE wo.wip_entity_id = WOR.wip_entity_id
      AND wo.operation_seq_num = WOR.operation_seq_num
      AND wo.wip_entity_id = p_wip_entity_id
      AND WOR.operation_seq_num = p_operation_seq_num
      AND WOR.resource_id = p_resource_id
      AND not exists ( SELECT 'x'
                       FROM bom_resource_employees bre,
                            bom_dept_res_instances bdri,
                            bom_department_resources bdr
                       WHERE bre.resource_id = wor.resource_id
                         AND bre.organization_id = wor.organization_id
                         --AND WO.department_id = bdri.department_id
                         AND nvl(bdr.share_from_dept_id, WO.department_id) = bdri.department_id
                         AND bdr.department_id = WO.department_id
                         AND bdr.resource_id = WOR.resource_id
                         AND WOR.RESOURCE_ID= bdri.resource_id
                         AND bre.instance_id = bdri.instance_id
                         AND bre.resource_id = bdri.resource_id
                         AND bre.person_id = p_employee_id);
Line: 2826

    SELECT resource_id
    FROM WIP_OPERATION_RESOURCES WOR
    WHERE WOR.wip_entity_id = p_wip_entity_id
      AND WOR.operation_seq_num = p_operation_seq_num
      AND WOR.resource_seq_num = p_resource_seq_num;
Line: 2836

    SELECT resource_code
    FROM BOM_RESOURCES
    WHERE RESOURCE_ID = p_resource_id
      AND organization_id = p_org_id
      AND resource_type = 2;
Line: 2844

    SELECT 'x'
    FROM AHL_WORKORDER_OPERATIONS
    WHERE workorder_id = p_workorder_id
      AND STATUS_CODE = '1' -- complete.
      AND rownum < 2;
Line: 2852

    SELECT operation_seq_num
    FROM WIP_OPERATIONS
    WHERE wip_entity_id = p_wip_entity_id;
Line: 3384

    SELECT wo.STATUS_CODE, wo.workorder_name, wo.wip_entity_id, we.organization_id
    FROM AHL_WORKORDERS WO, WIP_ENTITIES WE
    WHERE WO.wip_entity_id = we.wip_entity_id
      AND WORKORDER_ID = p_workorder_id;
Line: 3392

    SELECT 'x'
    FROM WIP_OPERATIONS WO
    WHERE wip_entity_id = p_wip_entity_id
      AND exists ( SELECT 'x'
                   FROM WIP_OPERATION_RESOURCES WOR, BOM_RESOURCES BRS
                   WHERE WOR.wip_entity_id = WO.wip_entity_id
                     AND WOR.operation_seq_num = WO.operation_seq_num
                     AND WOR.resource_id = BRS.resource_id
                     AND BRS.resource_type = 2  -- person.
                     );
Line: 3411

  SELECT 'x' -- status_code
  FROM AHL_WORKORDER_OPERATIONS
  WHERE WORKORDER_ID = p_workorder_id
  AND OPERATION_SEQUENCE_NUM = p_op_seq_num
  AND status_code = 2  -- uncomplete
  AND exists ( SELECT 'x'
               FROM wip_operation_resources WOR, bom_resources BRS
               WHERE WOR.wip_entity_id = p_wip_entity_id
                AND WOR.operation_seq_num = p_op_seq_num
                AND WOR.resource_id = BRS.resource_id
                AND BRS.resource_type = 2  -- person.
             );
Line: 3429

    SELECT 'x'
    FROM wip_operations wo
      WHERE wo.wip_entity_id = p_wip_entity_id
      and wo.operation_seq_num = p_operation_seq_num
      AND exists ( SELECT 'x'
                   FROM  wip_operation_resources WOR,
                         bom_resources BRS,
                         bom_resource_employees bre,
                         bom_dept_res_instances bdri,
                         bom_department_resources bdr
                   WHERE WOR.operation_seq_num = wo.operation_seq_num
                     AND WOR.wip_entity_id = wo.wip_entity_id
                     AND WOR.resource_id = BRS.resource_id
                     AND wor.organization_id = brs.organization_id
                     AND BRS.resource_type = 2  -- person.
                     AND brs.resource_id = bre.resource_id
                     AND brs.organization_id = bre.organization_id
                     --AND WO.department_id = bdri.department_id
                     AND nvl(bdr.share_from_dept_id, WO.department_id) = bdri.department_id
                     AND bdr.department_id = WO.department_id
                     AND bdr.resource_id = WOR.RESOURCE_ID
                     AND WOR.RESOURCE_ID= bdri.resource_id
                     AND bre.instance_id = bdri.instance_id
                     AND bre.resource_id = bdri.resource_id
                     AND bre.person_id = p_employee_id);
Line: 3462

    SELECT 'x'
    FROM wip_operations wo,
         wip_operation_resources WOR
    WHERE wo.wip_entity_id = WOR.wip_entity_id
      AND wo.operation_seq_num = WOR.operation_seq_num
      AND wo.wip_entity_id = p_wip_entity_id
      AND WOR.operation_seq_num = p_operation_seq_num
      AND WOR.resource_id = p_resource_id
      AND not exists ( SELECT 'x'
                       FROM bom_resource_employees bre,
                            bom_dept_res_instances bdri,
                            bom_department_resources bdr
                       WHERE bre.resource_id = wor.resource_id
                         AND bre.organization_id = wor.organization_id
                         --AND WO.department_id = bdri.department_id
                         AND nvl(bdr.share_from_dept_id, WO.department_id) = bdri.department_id
                         AND bdr.department_id = WO.department_id
                         AND bdr.resource_id = WOR.resource_id
                         AND WOR.RESOURCE_ID= bdri.resource_id
                         AND bre.instance_id = bdri.instance_id
                         AND bre.resource_id = bdri.resource_id
                         AND bre.person_id = p_employee_id);
Line: 3489

    SELECT resource_id
    FROM WIP_OPERATION_RESOURCES WOR
    WHERE WOR.wip_entity_id = p_wip_entity_id
      AND WOR.operation_seq_num = p_operation_seq_num
      AND WOR.resource_seq_num = p_resource_seq_num;
Line: 3499

    SELECT resource_code
    FROM BOM_RESOURCES
    WHERE RESOURCE_ID = p_resource_id
      AND organization_id = p_org_id
      AND resource_type = 2;
Line: 3507

    SELECT 'x'
    FROM AHL_WORKORDER_OPERATIONS
    WHERE workorder_id = p_workorder_id
      AND STATUS_CODE = '1' -- complete.
      AND rownum < 2;
Line: 3515

    SELECT operation_seq_num
    FROM WIP_OPERATIONS
    WHERE wip_entity_id = p_wip_entity_id;
Line: 3544

    SELECT WLGN.workorder_id,
             WLGN.operation_seq_num,
             AOR.resource_id,
             WLGN.resource_seq_num
      FROM AHL_Operation_Resources AOR, AHL_WORK_LOGIN_TIMES WLGN
      WHERE WLGN.operation_resource_id = AOR.operation_resource_id(+)
        AND WLGN.employee_id = c_employee_id
        AND WLGN.logout_date IS NULL;
Line: 3762

    SELECT WLGN.workorder_id,
             WLGN.operation_seq_num,
             AOR.resource_id,
             WLGN.resource_seq_num
      FROM AHL_Operation_Resources AOR, AHL_WORK_LOGIN_TIMES WLGN
      WHERE WLGN.operation_resource_id = AOR.operation_resource_id(+)
        AND WLGN.employee_id = c_employee_id
        AND WLGN.logout_date IS NULL;   --   employee logged in.