DBA Data[Home] [Help]

APPS.GMD_RESULTS_GRP SQL Statements

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

Line: 144

  SELECT   st.test_id
         , st.seq
         , st.test_replicate
         , tm.test_kit_inv_item_id
         , tm.resources, st.viability_duration
         , st.test_qty
         , st.test_qty_uom
         , tm.test_method_id
  FROM   gmd_spec_tests_b st, gmd_test_methods_b tm
  WHERE  st.spec_id = p_spec_id
  AND    st.exclude_ind IS NULL
  AND    ((p_lot_retest_ind IS NULL) OR
          (st.retest_lot_expiry_ind =  p_lot_retest_ind)
         )
  AND    st.test_method_id =  tm.test_method_id
  ;
Line: 162

  SELECT spec_id
  FROM   gmd_inventory_spec_vrs
  where  spec_vr_id = p_spec_vr_id
  UNION ALL
  SELECT spec_id
  FROM   gmd_wip_spec_vrs
  where  spec_vr_id = p_spec_vr_id
  UNION ALL
  SELECT spec_id
  FROM   gmd_customer_spec_vrs
  where  spec_vr_id = p_spec_vr_id
  UNION ALL
  SELECT spec_id
  FROM   gmd_supplier_spec_vrs
  where  spec_vr_id = p_spec_vr_id
  UNION ALL
  SELECT spec_id
  FROM   gmd_monitoring_spec_vrs
  where  spec_vr_id = p_spec_vr_id
  -- B3584185 Added following to the union query
  UNION ALL
  SELECT spec_id
  FROM   gmd_stability_spec_vrs
  where  spec_vr_id = p_spec_vr_id
;
Line: 215

  e_results_insert_error         EXCEPTION;
Line: 216

  e_spec_results_insert_error    EXCEPTION;
Line: 217

  e_event_spec_disp_insert_error EXCEPTION;
Line: 218

  e_sample_spec_disp_insert_err  EXCEPTION;
Line: 321

    SELECT meaning
    INTO   l_meaning
    FROM   gem_lookups
    WHERE  lookup_type = 'GMD_QC_SAMPLE_DISP'
    AND    lookup_code = l_sampling_event.disposition;
Line: 378

    l_event_spec_disp.delete_mark                  := 0;
Line: 381

    l_event_spec_disp.last_update_date             := l_date;
Line: 382

    l_event_spec_disp.last_updated_by              := l_user_id;
Line: 385

    IF NOT(gmd_event_spec_disp_pvt.insert_row(
                    p_event_spec_disp => l_event_spec_disp,
                    x_event_spec_disp => l_out_event_spec_disp)
            )
    THEN
      -- Insert Error
      RAISE e_event_spec_disp_insert_error;
Line: 422

    l_sample_spec_disp.delete_mark            := 0;
Line: 425

    l_sample_spec_disp.last_update_date       := l_date;
Line: 426

    l_sample_spec_disp.last_updated_by        := l_user_id;
Line: 437

    IF NOT(gmd_sample_spec_disp_pvt.Insert_Row(
                    p_sample_spec_disp => l_sample_spec_disp)
            )
    THEN
      -- Insert Error
      RAISE e_sample_spec_disp_insert_err;
Line: 536

        l_results.delete_mark                   := 0;
Line: 539

        l_results.last_updated_by               := l_user_id;
Line: 540

        l_results.last_update_date              := l_date;
Line: 625

        IF NOT(GMD_RESULTS_PVT.Insert_Row(
                      p_results => l_results,
                      x_results => l_out_results)
              )
        THEN
          -- Insert Error
          RAISE e_results_insert_error;
Line: 641

        l_spec_results.delete_mark              := 0;
Line: 644

        l_spec_results.last_updated_by          := l_user_id;
Line: 645

        l_spec_results.last_update_date         := l_date;
Line: 648

        IF NOT(gmd_spec_results_pvt.Insert_Row(p_spec_results => l_spec_results))
        THEN
          -- Insert Error
          RAISE e_spec_results_insert_error;
Line: 681

       UPDATE gmd_event_spec_disp
       SET    disposition = '2I',
              last_updated_by = l_user_id,
              last_update_date = l_date
       WHERE  event_spec_disp_id = l_event_spec_disp.event_spec_disp_id
       ;
Line: 692

       UPDATE gmd_sampling_events
       SET    disposition = '2I',
              last_updated_by = l_user_id,
              last_update_date = l_date
       WHERE  sampling_event_id = l_sampling_event.sampling_event_id
       ;
Line: 714

       OR e_results_insert_error
       OR e_spec_results_insert_error
       OR e_event_spec_disp_insert_error
       OR e_sample_spec_disp_insert_err
       OR e_event_spec_disp_fetch_error
  THEN
    x_return_status := FND_API.G_RET_STS_ERROR ;
Line: 749

PROCEDURE delete_rslt_and_spec_rslt_rows
(
  p_sample_id     IN         NUMBER
, x_return_status OUT NOCOPY VARCHAR2
) IS
BEGIN

  IF (l_debug = 'Y') THEN
    gmd_debug.put_line('Entering procedure DELETE_RSLT_AND_SPEC_RSLT_ROWS');
Line: 763

  DELETE gmd_spec_results
  WHERE result_id IN (SELECT result_id
                      FROM   gmd_results
                      WHERE  sample_id = p_sample_id)
  ;
Line: 770

    gmd_debug.put_line('Rows deleted from gmd_spec_results: '|| SQL%ROWCOUNT);
Line: 773

  DELETE gmd_results
  WHERE  sample_id = p_sample_id
  ;
Line: 778

    gmd_debug.put_line('Rows deleted from gmd_results: '|| SQL%ROWCOUNT);
Line: 782

    gmd_debug.put_line('Leaving procedure DELETE_RSLT_AND_SPEC_RSLT_ROWS');
Line: 792

                            'PACKAGE','DELETE_RSLT_AND_SPEC_RSLT_ROWS',
                            'ERROR', SUBSTR(SQLERRM,1,100));
Line: 796

END delete_rslt_and_spec_rslt_rows;
Line: 823

  SELECT event_spec_disp_id
  FROM   gmd_event_spec_disp
  WHERE  sampling_event_id            = p_sampling_event_id
  AND    spec_used_for_lot_attrib_ind = 'Y'
  AND    delete_mark                  = 0
  ;
Line: 906

  SELECT st.test_id
  FROM   gmd_spec_tests_b st
  WHERE  st.spec_id = p_spec_id
  AND    st.exclude_ind IS NULL
  AND    st.test_id NOT IN
    (SELECT r.test_id
     FROM   gmd_results r
     WHERE  r.sample_id = p_sample_id)
  ORDER BY st.seq
  ;
Line: 1010

  SELECT st.test_id
  FROM   gmd_spec_tests_b st
  WHERE  st.spec_id = p_spec_id
  AND    st.exclude_ind IS NULL
  AND    st.test_id NOT IN
    (SELECT cr.test_id
     FROM   gmd_composite_results cr
     WHERE  cr.composite_spec_disp_id = p_composite_spec_disp_id)
  ORDER BY st.seq
  ;
Line: 1113

  SELECT t.test_type, st.min_value_num, st.max_value_num, st.target_value_char
  FROM   gmd_qc_tests_b t, gmd_spec_tests_b st
  WHERE  t.test_id= st.test_id
  AND    st.exclude_ind IS NULL
  AND    st.spec_id = p_spec_id
  AND    st.test_id = p_test_id
  ;
Line: 1123

  SELECT text_range_seq
  FROM   gmd_qc_test_values_b
  WHERE  test_id        = p_test_id
  AND    value_char     = p_value_char
  ;
Line: 1131

  SELECT 1
  FROM   gmd_qc_test_values_b
  WHERE  test_id = p_test_id
  AND    nvl(min_num, p_num) <= p_num
  AND    nvl(max_num, p_num) >= p_num
  ;
Line: 1333

	  SELECT tm.test_kit_inv_item_id,
                 tm.test_replicate,
                 tm.test_method_id, -- 5353794
                 tm.test_qty,
                 tm.test_qty_uom
	  FROM   gmd_qc_tests_b t, gmd_test_methods_b tm
	  WHERE  t.test_id =  p_test_id
	  AND    t.test_method_id = tm.test_method_id
	  ;
Line: 1345

	 SELECT disposition
         FROM gmd_sample_spec_disp
         WHERE sample_id = p_sample_id
         AND event_spec_disp_id = p_event_spec_disp_id ;
Line: 1382

	  e_results_insert_error         EXCEPTION;
Line: 1383

	  e_spec_results_insert_error    EXCEPTION;
Line: 1436

	    SELECT meaning
	    INTO   l_meaning
	    FROM   gem_lookups
	    WHERE  lookup_type = 'GMD_QC_SAMPLE_DISP'
	    AND    lookup_code = l_sample_spec_disp;  -- 3903309
Line: 1477

	    SELECT test_type
	    INTO   l_test_type
	    FROM   gmd_qc_tests_b
	    WHERE  test_id = p_test_ids(i)
	    ;
Line: 1540

	    SELECT NVL(MAX(test_replicate_cnt), 0) + 1
	    INTO   l_next_test_replicate_cnt
	    FROM   gmd_results
	    WHERE  sample_id = l_sample.sample_id
	    AND    test_id   = p_test_ids(i)
	    ;
Line: 1565

      SELECT st.test_replicate, st.viability_duration, tm.resources
      INTO   l_replicate,l_viability_duration, l_resources
      FROM   gmd_spec_tests_b st, gmd_test_methods_b tm
      WHERE  st.spec_id = l_event_spec_disp.spec_id
      AND    st.exclude_ind IS NULL
      AND    st.test_id = p_test_ids(i)
      AND    st.test_method_id = tm.test_method_id
      ;
Line: 1596

    l_results.delete_mark                   := 0;
Line: 1599

    l_results.last_updated_by               := l_user_id;
Line: 1600

    l_results.last_update_date              := l_date;
Line: 1629

    l_spec_results.delete_mark              := 0;
Line: 1632

    l_spec_results.last_updated_by          := l_user_id;
Line: 1633

    l_spec_results.last_update_date         := l_date;
Line: 1640

         gmd_debug.put_line('Inserting test for replicate: ' || l_results.TEST_REPLICATE_CNT);
Line: 1643

      IF NOT(GMD_RESULTS_PVT.Insert_Row(
                    p_results => l_results,
                    x_results => l_out_results)
            )
      THEN
        -- Insert Error
        RAISE e_results_insert_error;
Line: 1658

         gmd_debug.put_line('Result record inserted, Result ID: ' || l_results.RESULT_ID);
Line: 1665

      IF NOT(GMD_SPEC_RESULTS_PVT.Insert_Row(p_spec_results => l_spec_results))
      THEN
        -- Insert Error
        RAISE e_spec_results_insert_error;
Line: 1674

         gmd_debug.put_line('Spec Result record inserted');
Line: 1710

    UPDATE gmd_sample_spec_disp
    SET    disposition = '2I',
           last_updated_by = l_user_id,
           last_update_date = l_date
    WHERE  event_spec_disp_id = p_event_spec_disp_id
    AND    sample_id = l_sample.sample_id
    ;
Line: 1721

      UPDATE gmd_event_spec_disp
      SET    disposition = '2I',
             last_updated_by = l_user_id,
             last_update_date = l_date
      WHERE  event_spec_disp_id = p_event_spec_disp_id
      ;
Line: 1733

    UPDATE gmd_sampling_events
    SET    disposition = '2I',
	   recomposite_ind = 'Y',
           last_updated_by = l_user_id,
           last_update_date = l_date
    WHERE  sampling_event_id = l_sample.sampling_event_id
    ;
Line: 1753

       e_results_insert_error OR
       e_spec_results_insert_error OR
       e_samples_fetch_error OR
       e_event_spec_fetch_error OR
       e_sampling_event_fetch_error
  THEN
    x_return_status := FND_API.G_RET_STS_ERROR ;
Line: 1793

  SELECT seq
  FROM   gmd_results
  WHERE  sample_id = p_sample_id
  AND    test_id   = p_test_id
  ;
Line: 1808

    SELECT (floor(nvl(max(seq),0) / 10) * 10) + 10
    INTO   l_seq
    FROM   gmd_results
    WHERE  sample_id = p_sample_id
    ;
Line: 1849

  SELECT 1
  FROM   gmd_qc_test_values_b tv
  WHERE  tv.test_id = p_test_id
  AND    tv.expression_ref_test_id NOT IN
    (SELECT test_id
     FROM   gmd_results
     WHERE  sample_id = p_sample_id)
  ;
Line: 2038

  SELECT result_id,
         test_id,
         result_value_num,
         result_value_char,
         result_date              --Bug 5220513
  FROM   gmd_results
  WHERE  sample_id = p_sample_id
  ;
Line: 2048

  SELECT   st.test_id
         , st.test_replicate
         , tm.test_kit_inv_item_id
  FROM   gmd_spec_tests_b st, gmd_test_methods_b tm
  WHERE  st.spec_id = p_spec_id
  AND    st.exclude_ind IS NULL
  AND    st.test_method_id =  tm.test_method_id
  ;
Line: 2059

  SELECT spec_id
  FROM   gmd_com_spec_vrs_vl
  WHERE  spec_vr_id = p_spec_vr_id
  ;
Line: 2065

  SELECT *
  FROM   gmd_event_spec_disp
  WHERE  sampling_event_id = p_sampling_event_id
  AND    spec_vr_id = p_spec_vr_id
  AND    spec_used_for_lot_attrib_ind = 'Y'
  ;
Line: 2077

  SELECT evaluation_ind  from gmd_spec_results gsr, gmd_event_spec_disp  esd --, gmd_sample_spec_disp ssd
  WHERE gsr.result_id=p_result_id
  AND esd.event_spec_disp_id=p_event_spec_disp_id
  AND gsr.event_spec_disp_id=esd.event_spec_disp_id;
Line: 2084

  SELECT esd.event_spec_disp_id from gmd_event_spec_disp  esd, gmd_sample_spec_disp ssd
  WHERE ssd.sample_id=p_sample_id
  AND esd.event_spec_disp_id=ssd.event_spec_disp_id
  AND esd.spec_used_for_lot_attrib_ind = 'Y';
Line: 2090

      SELECT  t.test_type, t.test_code, t.test_method_id, t.expression, t.test_unit,
      	      m.test_method_code
      FROM    gmd_qc_tests_b t , gmd_test_methods_b m
      WHERE   t.test_id = l_test_id
      AND     t.test_method_id = m.test_method_id;
Line: 2099

    SELECT  v.display_label_numeric_range
    FROM    gmd_qc_test_values v
    WHERE   v.test_id = l_test_id;
Line: 2106

      SELECT  s.min_value_num, s.max_value_num, s.target_value_num,s.display_precision
      FROM    gmd_spec_tests_b s
      WHERE   s.spec_id = l_spec_id
      AND     s.test_id = l_test_id
      AND     s.exclude_ind IS NULL;
Line: 2115

      SELECT  s.min_value_char, s.max_value_char, s.target_value_char
      FROM    gmd_spec_tests_b s
      WHERE   s.spec_id = l_spec_id
      AND     s.test_id = l_test_id
      AND     s.exclude_ind IS NULL;
Line: 2124

    SELECT  *
    FROM   gmd_spec_tests_b
    WHERE  spec_id = p_spec_id
    AND    test_id = p_test_id
   ;
Line: 2140

  SELECT organization_code
  FROM mtl_parameters
  WHERE organization_id = l_organization_id;
Line: 2168

  e_event_spec_disp_insert_error EXCEPTION;
Line: 2169

  e_sample_spec_disp_insert_err  EXCEPTION;
Line: 2170

  e_spec_results_insert_error    EXCEPTION;
Line: 2250

    UPDATE gmd_event_spec_disp
    set    spec_used_for_lot_attrib_ind = NULL
    where  sampling_event_id = l_sample.sampling_event_id
    and    spec_used_for_lot_attrib_ind = 'Y'
    ;
Line: 2257

       gmd_debug.put_line('  Updated all previous gmd_event_spec_disp to NOT-Current.');
Line: 2272

    l_event_spec_disp.DELETE_MARK                  := 0;
Line: 2275

    l_event_spec_disp.LAST_UPDATE_DATE             := l_date;
Line: 2276

    l_event_spec_disp.LAST_UPDATED_BY              := l_user_id;
Line: 2279

    IF NOT(GMD_EVENT_SPEC_DISP_PVT.Insert_Row(
                    p_event_spec_disp => l_event_spec_disp,
                    x_event_spec_disp => l_out_event_spec_disp)
            )
    THEN
      -- Insert Error
      RAISE e_event_spec_disp_insert_error;
Line: 2302

  l_sample_spec_disp.DELETE_MARK                  := 0;
Line: 2305

  l_sample_spec_disp.LAST_UPDATE_DATE             := l_date;
Line: 2306

  l_sample_spec_disp.LAST_UPDATED_BY              := l_user_id;
Line: 2309

  IF NOT(GMD_SAMPLE_SPEC_DISP_PVT.Insert_Row(
                  p_sample_spec_disp => l_sample_spec_disp)
          )
  THEN
    -- Insert Error
    RAISE e_sample_spec_disp_insert_err;
Line: 2485

    l_spec_result.DELETE_MARK              := 0;
Line: 2488

    l_spec_result.LAST_UPDATED_BY          := l_user_id;
Line: 2489

    l_spec_result.LAST_UPDATE_DATE         := l_date;
Line: 2492

    IF NOT(GMD_SPEC_RESULTS_PVT.Insert_Row(p_spec_results => l_spec_result))
    THEN
      -- Insert Error
      RAISE e_spec_results_insert_error;
Line: 2519

    SELECT nvl(max(test_replicate_cnt), 0)
    INTO   l_curr_replicate_cnt
    FROM   GMD_RESULTS
    WHERE  sample_id = l_sample.sample_id
    AND    test_id   = l_spec_test.test_id
    ;
Line: 2541

      l_test_ids.DELETE;
Line: 2603

       OR e_spec_results_insert_error
       OR e_event_spec_disp_insert_error
       OR e_sample_spec_disp_insert_err
  THEN
    x_return_status := FND_API.G_RET_STS_ERROR ;
Line: 2658

  SELECT sampling_event_id
  FROM   gmd_composite_spec_disp csd, gmd_event_spec_disp esd
  WHERE  csd.composite_spec_disp_id = p_composite_spec_disp_id
  AND    csd.event_spec_disp_id = esd.event_spec_disp_id
  AND    csd.latest_ind = 'Y'
  AND    csd.delete_mark = 0
  AND    esd.spec_used_for_lot_attrib_ind = 'Y'
  AND    esd.delete_mark = 0
  ;
Line: 2829

     SELECT *
     FROM	gmd_result_data_points_gt;
Line: 2833

      SELECT  t.test_type, t.test_code, t.test_method_id, t.expression, t.test_unit,
      	      m.test_method_code
      FROM    gmd_qc_tests_b t , gmd_test_methods_b m
      WHERE   t.test_id = l_test_id
      AND     t.test_method_id = m.test_method_id;
Line: 2841

    SELECT  v.display_label_numeric_range
    FROM    gmd_qc_test_values v
    WHERE   v.test_id = l_test_id;
Line: 2849

      SELECT  s.min_value_num, s.max_value_num, s.target_value_num,s.display_precision
      FROM    gmd_spec_tests_b s
      WHERE   s.spec_id = l_spec_id
      AND     s.test_id = l_test_id
      AND     s.exclude_ind IS NULL;
Line: 2863

      SELECT  s.min_value_char, s.max_value_char, s.target_value_char
      FROM    gmd_spec_tests_b s
      WHERE   s.spec_id = l_spec_id
      AND     s.test_id = l_test_id
      AND     s.exclude_ind IS NULL;
Line: 2872

    SELECT *
    FROM gmd_results
    WHERE sample_id = p_sample_id;
Line: 2947

    l_results_rec_tbl.DELETE;
Line: 3014

      SELECT sr.additional_test_ind
      INTO   X_additional_test
      FROM   gmd_spec_results sr
      WHERE  sr.event_spec_disp_id = p_event_spec_disp_id
      AND    sr.result_id          = LocalResRec.result_id
      ;
Line: 3023

        SELECT display_precision
        INTO X_display_precision
        FROM gmd_qc_tests_b
        WHERE test_id = l_test_id;
Line: 3209

  SELECT 1
  FROM   gmd_composite_spec_disp
  WHERE  event_spec_disp_id = p_event_spec_disp_id
  AND    nvl(latest_ind, 'N') = 'Y'
  ;
Line: 3216

  SELECT nvl(recomposite_ind, 'N')
  FROM   gmd_sampling_events
  WHERE  sampling_event_id = p_sampling_event_id
  ;
Line: 3345

  SELECT 1
  FROM   gmd_composite_spec_disp
  WHERE  event_spec_disp_id = p_event_spec_disp_id
  AND    nvl(latest_ind, 'N') = 'Y'
  ;
Line: 3380

    UPDATE gmd_sampling_events
    SET    recomposite_ind = 'Y'
    WHERE  sampling_event_id = p_sampling_event_id;
Line: 3429

  SELECT 1
  FROM   gmd_composite_spec_disp csd, gmd_composite_results cr, gmd_composite_result_assoc cra
  WHERE  csd.event_spec_disp_id = p_event_spec_disp_id
  AND    csd.composite_spec_disp_id = cr.composite_spec_disp_id
  AND    cr.composite_result_id = cra.composite_result_id
  AND    cra.result_id = p_result_id
  AND    nvl(csd.latest_ind, 'N') = 'Y'
  ;
Line: 3456

    UPDATE gmd_sampling_events
    SET    recomposite_ind = 'Y'
    WHERE  sampling_event_id =
      (SELECT sampling_event_id
       FROM   gmd_event_spec_disp
       WHERE  event_spec_disp_id = p_event_spec_disp_id);
Line: 3512

  SELECT s.sample_id
  FROM   gmd_event_spec_disp esd,
         gmd_sample_spec_disp ssd,
         gmd_samples s
  WHERE  esd.sampling_event_id = p_sampling_event_id
  AND    esd.spec_used_for_lot_attrib_ind = 'Y'
  AND    esd.event_spec_disp_id = ssd.event_spec_disp_id
  AND    ssd.sample_id = s.sample_id
  AND    nvl(ssd.disposition, 'XX') NOT IN ('0RT', '7CN', '0PL')
  AND    esd.delete_mark     = 0
  AND    ssd.delete_mark     = 0
  AND    s.delete_mark       = 0
  ORDER BY s.sample_id
  ;
Line: 3628

  EXECUTE IMMEDIATE 'delete from gmd_result_data_points_gt';
Line: 3630

    'INSERT INTO gmd_result_data_points_gt (result_id, test_id, exclude_ind,  data_num, data_char)'
  ||' ('
  ||'  SELECT result_id, test_id, 0, result_value_num, result_value_char FROM'
  ||'  ('
  ||'    SELECT r.result_id, r.test_id, r.result_value_num, r.result_value_char,'
  ||'           r.result_date, r.test_replicate_cnt,'
  ||'           last_value(r.result_id)'
  ||'           over (partition by r.test_id order by NVL(r.result_date, :l_start_date),'
  ||'                                                 r.test_replicate_cnt'
  ||'                 range between unbounded preceding and unbounded following) rmax_id'
  ||'    FROM   gmd_results r, gmd_spec_results sr, gmd_samples s'
  ||'    WHERE  r.result_id = sr.result_id'
  ||'    AND    r.sample_id = :l_sample_id'
  ||'    AND    sr.event_spec_disp_id = :l_event_spec_disp_id'
  ||'    AND    nvl(sr.evaluation_ind, ' || '''' || 'XX' || '''' || ')  not in ('
  ||                         '''' || '5O' || '''' ||','|| '''' || '4C' || '''' ||')'
  ||'    AND    sr.delete_mark = 0'
  ||'    AND    r.delete_mark = 0'
  ||'    AND    r.sample_id = s.sample_id'
  ||'    AND    s.retain_as IS NULL'
  ||'  )'
  ||'  WHERE result_id = rmax_id'
  ||')'
  ;
Line: 3692

  SELECT *
  FROM   gmd_result_data_points_gt
  ORDER BY TEST_ID;
Line: 3744

  SELECT gt.test_id
  FROM   gmd_result_data_points_gt gt, gmd_results r
  WHERE  gt.result_id = r.result_id
  GROUP BY gt.test_id
  ORDER BY min(r.seq)
  ;
Line: 3752

  SELECT result_id, data_num, data_char
  FROM   gmd_result_data_points_gt
  WHERE  test_id = p_test_id
  ;
Line: 3758

  SELECT spec_id
  FROM   gmd_event_spec_disp
  WHERE  event_spec_disp_id = p_event_spec_disp_id
  ;
Line: 3764

  SELECT test_type, display_precision
  FROM   gmd_qc_tests_b
  WHERE  test_id = p_test_id
  ;
Line: 3770

  SELECT display_precision
  FROM   gmd_spec_tests_b
  WHERE  spec_id = p_spec_id
  AND    test_id = p_test_id
  AND    exclude_ind IS NULL
  ;
Line: 3810

  e_comp_spec_disp_insert_error  EXCEPTION;
Line: 3811

  e_comp_result_insert_error     EXCEPTION;
Line: 3812

  e_spec_comp_rslt_insert_error  EXCEPTION;
Line: 3813

  e_comp_rslt_assoc_insert_error EXCEPTION;
Line: 3843

  UPDATE  gmd_composite_spec_disp
  SET     latest_ind = NULL
  WHERE   event_spec_disp_id = p_event_spec_disp_id
  AND     latest_ind = 'Y'
  ;
Line: 3859

  l_composite_spec_disp.DELETE_MARK              := 0;
Line: 3862

  l_composite_spec_disp.LAST_UPDATE_DATE         := l_date;
Line: 3863

  l_composite_spec_disp.LAST_UPDATED_BY          := l_user_id;
Line: 3866

  IF NOT(GMD_COMPOSITE_SPEC_DISP_PVT.Insert_Row(
                  p_composite_spec_disp => l_composite_spec_disp,
                  x_composite_spec_disp => l_out_composite_spec_disp)
         )
  THEN
    -- Insert Error
    RAISE e_comp_spec_disp_insert_error;
Line: 3877

     gmd_debug.put_line('  Record inserted in GMD_COMPOSITE_SPEC_DISP, CSD ID-' || l_composite_spec_disp.composite_spec_disp_id);
Line: 4040

    l_composite_result.DELETE_MARK              := 0;
Line: 4043

    l_composite_result.LAST_UPDATE_DATE         := l_date;
Line: 4044

    l_composite_result.LAST_UPDATED_BY          := l_user_id;
Line: 4046

    IF NOT(GMD_COMPOSITE_RESULTS_PVT.Insert_Row(
                    p_composite_results => l_composite_result,
                    x_composite_results => l_out_composite_result)
            )
    THEN
      -- Insert Error
      RAISE e_comp_result_insert_error;
Line: 4072

      l_composite_result_assoc.LAST_UPDATE_DATE         := l_date;
Line: 4073

      l_composite_result_assoc.LAST_UPDATED_BY          := l_user_id;
Line: 4076

      IF NOT(GMD_COMPOSITE_RESULT_ASSOC_PVT.Insert_Row(
                      p_composite_result_assoc => l_composite_result_assoc)
              )
      THEN
        -- Insert Error
        RAISE e_comp_rslt_assoc_insert_error;
Line: 4097

    UPDATE gmd_composite_results
    SET    sample_total = sample_cnt,
	   sample_cnt_used = sample_cnt
    WHERE  composite_result_id = l_composite_result.composite_result_id
    AND    test_id = test_rec.test_id
    ;
Line: 4114

       e_comp_spec_disp_insert_error OR
       e_comp_result_insert_error OR
       e_comp_rslt_assoc_insert_error
       THEN
    x_return_status := FND_API.G_RET_STS_ERROR ;
Line: 4155

  SELECT test_type
  FROM   gmd_qc_tests_b
  WHERE  test_id = p_test_id
  ;
Line: 4161

  SELECT avg(data_num)
  FROM   gmd_result_data_points_gt
  WHERE  test_id = p_test_id
  AND    exclude_ind = 0
  AND    data_num IS NOT NULL
  ;
Line: 4250

  SELECT test_type
  FROM   gmd_qc_tests_b
  WHERE  test_id = p_test_id
  ;
Line: 4256

  SELECT avg(data_num)
  FROM
  (
    SELECT max(data_num) data_num
    FROM
    (
      SELECT data_num
      FROM
      (
        SELECT data_num
        FROM   gmd_result_data_points_gt
        WHERE  test_id = p_test_id
        AND    exclude_ind = 0
	AND    data_num IS NOT NULL
        ORDER BY data_num
      )
      WHERE rownum <= (SELECT ceil(count(*)/2)
                       FROM   gmd_result_data_points_gt
                       WHERE  test_id = p_test_id
                       AND    exclude_ind = 0
		       AND    data_num IS NOT NULL)
    )
    UNION
    SELECT min(data_num) data_num
    FROM
    (
      SELECT data_num
      FROM
      (
        SELECT data_num
        FROM   gmd_result_data_points_gt
        WHERE  test_id = p_test_id
        AND    exclude_ind = 0
	AND    data_num IS NOT NULL
        ORDER BY data_num desc
      )
      WHERE rownum <= (SELECT ceil(count(*)/2)
                       FROM gmd_result_data_points_gt
                       WHERE  test_id = p_test_id
                       AND    exclude_ind = 0
		       AND    data_num IS NOT NULL)
    )
  )
  ;
Line: 4302

  SELECT value_char
  FROM   gmd_qc_test_values_b
  WHERE  test_id        = p_test_id
  AND    text_range_seq = p_num
  ;
Line: 4330

  SELECT nvl(count(*), 0)
  INTO   l_count
  FROM   gmd_result_data_points_gt
  WHERE  test_id = p_test_id
  AND    exclude_ind = 0
  AND    data_num IS NOT NULL
  ;
Line: 4417

  SELECT data_num
  FROM   gmd_result_data_points_gt
  WHERE  test_id = p_test_id
  AND    exclude_ind = 0
  AND    data_num IS NOT NULL
  GROUP BY data_num
  HAVING count(*) = (SELECT max(count(*))
                     FROM   gmd_result_data_points_gt
                     WHERE  test_id = p_test_id
                     AND    exclude_ind = 0
		     AND    data_num IS NOT NULL
                     GROUP BY data_num)
  ;
Line: 4432

  SELECT data_char
  FROM   gmd_result_data_points_gt
  WHERE  test_id = p_test_id
  AND    exclude_ind = 0
  AND    data_char IS NOT NULL
  GROUP BY data_char
  HAVING count(*) = (SELECT max(count(*))
                     FROM   gmd_result_data_points_gt
                     WHERE  test_id = p_test_id
                     AND    exclude_ind = 0
		     AND    data_char IS NOT NULL
                     GROUP BY data_char)
  ;
Line: 4448

  SELECT test_type
  FROM   gmd_qc_tests_b
  WHERE  test_id = p_test_id
  ;
Line: 4454

  SELECT value_char
  FROM   gmd_qc_test_values_b
  WHERE  test_id        = p_test_id
  AND    text_range_seq = p_num
  ;
Line: 4575

  SELECT max(data_num)
  FROM   gmd_result_data_points_gt
  WHERE  test_id = p_test_id
  AND    exclude_ind = 0
  AND    data_num IS NOT NULL
  ;
Line: 4583

  SELECT test_type
  FROM   gmd_qc_tests_b
  WHERE  test_id = p_test_id
  ;
Line: 4612

    SELECT value_char
    INTO   x_high_char
    FROM   gmd_qc_test_values_b
    WHERE  test_id        = p_test_id
    AND    text_range_seq = x_high_num
    ;
Line: 4670

  SELECT min(data_num)
  FROM   gmd_result_data_points_gt
  WHERE  test_id = p_test_id
  AND    exclude_ind = 0
  AND    data_num IS NOT NULL
  ;
Line: 4678

  SELECT test_type
  FROM   gmd_qc_tests_b
  WHERE  test_id = p_test_id
  ;
Line: 4707

    SELECT value_char
    INTO   x_low_char
    FROM   gmd_qc_test_values_b
    WHERE  test_id        = p_test_id
    AND    text_range_seq = x_low_num
    ;
Line: 4760

  SELECT test_type
  FROM   gmd_qc_tests_b
  WHERE  test_id = p_test_id
  ;
Line: 4766

  SELECT stddev(data_num)
  FROM   gmd_result_data_points_gt
  WHERE  test_id = p_test_id
  AND    exclude_ind = 0
  AND    data_num IS NOT NULL
  ;
Line: 4864

  SELECT cr.composite_spec_disp_id,
         cr.composite_result_id,
         cr.in_spec_ind,
         cr.test_id,
         cr.median_num,
         cr.median_char,
         cr.mode_num,
         cr.mode_char
   FROM  gmd_composite_results cr
   WHERE cr.composite_spec_disp_id = p_composite_spec_disp_id;
Line: 4877

      SELECT  t.test_type, t.test_code, t.test_method_id, m.test_method_code
      FROM    gmd_qc_tests_b t , gmd_test_methods_b m
      WHERE   t.test_id = l_test_id
      AND     t.test_method_id = m.test_method_id;
Line: 4884

      SELECT  s.min_value_num, s.max_value_num, s.target_value_num
      FROM    gmd_spec_tests_b s
      WHERE   s.spec_id = l_spec_id
      AND     s.test_id = l_test_id
      AND     s.exclude_ind IS NULL;
Line: 4892

      SELECT  s.min_value_char, s.max_value_char, s.target_value_char
      FROM    gmd_spec_tests_b s
      WHERE   s.spec_id = l_spec_id
      AND     s.test_id = l_test_id
      AND     s.exclude_ind IS NULL;
Line: 4906

    l_comres_tab.DELETE;
Line: 5091

  SELECT transaction_reason_id
  FROM   gmd_quality_config
  WHERE  organization_id = p_organization_id
  AND    transaction_reason_id IS NOT NULL
  ;
Line: 5123

    gmd_samples_grp.update_lot_grade_batch(         -- nsrivast
	  	  p_sample_id		=> p_sample_id
		, p_composite_spec_disp_id  => NULL
		, p_to_lot_status_id	=> p_lot_status
        , p_from_lot_status_id	=> NULL --p_from_lot_status
		, p_to_grade_code		=> NULL
        , p_from_grade_code		=> NULL
		, p_to_qc_status	=> NULL
 	    , p_hold_date       => NULL
		, p_reason_id		=> l_reason_id
 --   , p_update_child => NULL -- Added for Results Convergence. rboddu.
		, x_return_status 	=> x_return_status
		, x_message_data	=> l_message_data );
Line: 5342

 SELECT 1
 FROM cr_rsrc_mst
 WHERE resources = p_resource
 AND   delete_mark = 0;
Line: 5350

 SELECT 1
 FROM   gmp_resource_instances ri,
       cr_rsrc_dtl rd
 WHERE rd.resources  = p_resource
 AND   rd.organization_id =  p_lab_organization_id
 AND   rd.resource_id = ri.resource_id
 AND   ri.instance_id = p_resource_instance
 AND   ri.inactive_ind = 0;
Line: 5778

      SELECT  expression_ref_test_id
        FROM  gmd_qc_test_values_b
       where test_id = p_exp_test_id;
Line: 5787

  SELECT t.test_id, t.test_code, t.expression, t.display_precision,
         t.report_precision, r.result_id, r.result_value_num
  FROM   gmd_samples s,
         gmd_results r,
         gmd_spec_results sr,
         gmd_qc_tests_b t
  WHERE  s.sample_id = r.sample_id
  AND    s.sample_id = p_sample_id
  AND    s.retain_as IS NULL
  AND    r.result_id = sr.result_id
  AND    sr.event_spec_disp_id = p_event_spec_disp_id
  AND    NVL(sr.evaluation_ind, 'XX') NOT IN ('5O','4C')
  AND    r.test_id = t.test_id
  AND    t.test_type= 'E'
  AND    sr.delete_mark = 0
  AND    r.delete_mark = 0;
Line: 5809

    SELECT  *
    FROM   gmd_spec_tests_b
    WHERE  spec_id = p_spec_id
    AND    test_id = p_test_id
   ;
Line: 5816

    SELECT ADDITIONAL_TEST_IND
    FROM   gmd_spec_results
    WHERE  event_spec_disp_id = p_event_spec_id
    AND    result_id          = p_result_id
    ;
Line: 5823

    SELECT min_value_num,max_value_num
    FROM   gmd_qc_tests_b
    WHERE  test_id = p_test_id
    ;
Line: 5837

  SELECT gtmp.data_num,
         t.test_code
  FROM   gmd_result_data_points_gt gtmp,
         gmd_results r,
         gmd_qc_tests_b t,
         gmd_qc_test_values_b tv
  WHERE  gtmp.result_id = r.result_id
  AND    r.test_id = t.test_id
  AND    t.test_id = tv.expression_ref_test_id
  AND    tv.test_id = p_exp_test_id
  ;
Line: 5850

  SELECT display_precision, report_precision
  FROM   gmd_spec_tests_b
  WHERE  spec_id = p_spec_id
  AND    test_id = p_test_id
  AND    exclude_ind IS NULL
  ;
Line: 5907

    l_exptab.DELETE;
Line: 5920

     select count(*) INTO l_ref_count from gmd_qc_test_values_b where test_id=l_exp_test.test_id; --Bug#5097709
Line: 5993

    UPDATE gmd_results
    SET    result_value_num = l_display_value,
           result_date = SYSDATE
    WHERE  result_id = l_exp_test.result_id
    ;
Line: 6000

     UPDATE gmd_results
     SET    result_date = NULL
     WHERE  result_id = l_exp_test.result_id
     AND  result_value_num IS NULL;
Line: 6048

    UPDATE gmd_spec_results
    SET    value_in_report_precision = l_report_value,
           in_spec_ind = x_rec.in_spec,
           action_code = x_rec.result_action_code,
           evaluation_ind = x_rec.evaluation_ind
    WHERE  event_spec_disp_id = p_event_spec_disp_id
    AND    result_id          = l_exp_test.result_id
    ;
Line: 6125

  l_update_disp_rec               GMD_SAMPLES_GRP.update_disp_rec;
Line: 6196

  SELECT count(1)
  INTO   l_count
  FROM   gmd_spec_results sr, gmd_results r
  WHERE  sr.event_spec_disp_id = l_event_spec_disp.event_spec_disp_id
  AND    sr.result_id          = r.result_id
  AND    r.sample_id           = l_sample.sample_id
  AND    (((r.result_value_num IS NOT NULL OR r.result_value_char IS NOT NULL) AND
          nvl(sr.evaluation_ind, 'XX') not in ( '4C')) OR
          (r.result_value_num IS NULL AND r.result_value_char IS NULL AND
          sr.evaluation_ind = '1Z'))

  AND    r.delete_mark         = 0
  ;
Line: 6242

      SELECT count(1) INTO l_qlty_config_present
      FROM gmd_quality_config
      WHERE organization_id = l_sample.organization_id;
Line: 6248

	      -- Select COUNT of Incomplete Tests in Sample WITH Spec
	      SELECT count(1)
	      INTO   l_incomplete_count_from_spec
	      FROM   gmd_results r, gmd_spec_tests st, gmd_spec_results sr
	      WHERE  sr.event_spec_disp_id = l_event_spec_disp.event_spec_disp_id
	      AND    sr.result_id          = r.result_id
	      AND    r.sample_id           = l_sample.sample_id
	      AND    st.spec_id            = l_event_spec_disp.spec_id
	      AND    st.test_id            = r.test_id
	      AND    st.exclude_ind IS NULL
	      AND    st.optional_ind IS NULL             -- Check only REQUIRED tests
	      AND    (sr.evaluation_ind is NULL          -- No Evaluation --> Incomplete
	               OR sr.evaluation_ind = '3E'       -- Evaluation is 'Exp Error' --> Incomplete
	               OR ( r.result_value_num    IS NULL
	                    AND r.result_value_char   IS NULL
	                    AND sr.evaluation_ind not in ('4C', '5O', '1Z')  -- Result not entered
	                  )
	             )
	      AND  r.delete_mark         = 0              -- Check only active ones
	      ;
Line: 6269

	      SELECT count(1)
	      INTO   l_incomplete_count_from_spec
	      FROM   gmd_results r, gmd_spec_tests st, gmd_spec_results sr,gmd_quality_config gc
	      WHERE  sr.event_spec_disp_id = l_event_spec_disp.event_spec_disp_id
	      AND    sr.result_id          = r.result_id
	      AND    r.sample_id           = l_sample.sample_id
	      AND    st.spec_id            = l_event_spec_disp.spec_id
	      AND    st.test_id            = r.test_id
	      AND    st.exclude_ind IS NULL
	      AND    gc.organization_id = l_sample.organization_id
	      AND   (
	             ( (gc.include_optional_test_rslt_ind IS NULL OR gc.include_optional_test_rslt_ind='N') and st.optional_ind IS NULL)  OR
	              (gc.include_optional_test_rslt_ind ='Y')
	            )
	      AND    (sr.evaluation_ind is NULL          -- No Evaluation --> Incomplete
	               OR sr.evaluation_ind = '3E'       -- Evaluation is 'Exp Error' --> Incomplete
	               OR ( r.result_value_num    IS NULL
	                    AND r.result_value_char   IS NULL
	                    AND sr.evaluation_ind not in ('4C', '5O', '1Z')  -- Result not entered
	                  )
	             )
	      AND  r.delete_mark         = 0              -- Check only active ones
	      ;
Line: 6299

      SELECT count(1)
      INTO   l_incomplete_count_additional
      FROM   gmd_results r, gmd_spec_results sr
      WHERE  sr.result_id          = r.result_id
      AND    sr.event_spec_disp_id = l_event_spec_disp.event_spec_disp_id
      AND    r.sample_id           = l_sample.sample_id
      AND    sr.additional_test_ind = 'Y'
      AND    (sr.evaluation_ind  is NULL
               OR sr.evaluation_ind = '3E'
               OR ( r.result_value_num    IS NULL
                    AND r.result_value_char   IS NULL
                    AND sr.evaluation_ind not in ('4C', '5O')
                  )
             )
      AND    r.delete_mark         = 0
      ;
Line: 6356

    l_update_disp_rec.sample_id               := l_sample.sample_id;
Line: 6357

    l_update_disp_rec.event_spec_disp_id      := l_event_spec_disp.event_spec_disp_id;
Line: 6359

    l_update_disp_rec.no_of_samples_for_event := l_sampling_event.sample_req_cnt;
Line: 6361

    l_update_disp_rec.curr_disposition 	      := l_sample_spec_disp.disposition;
Line: 6366

       gmd_debug.put_line ('  Call GMD_SAMPLES_GRP.update_sample_comp_disp '|| l_sample_spec_disp.disposition);
Line: 6369

    GMD_SAMPLES_GRP.update_sample_comp_disp(
                 p_update_disp_rec => l_update_disp_rec
               , p_to_disposition  => l_change_disp_to
               , x_return_status   => x_return_status
               , x_message_data    => x_message_data);
Line: 6434

  SELECT se.sampling_event_id,
         se.sample_active_cnt,
         se.sample_req_cnt,
         esd.event_spec_disp_id,
         esd.spec_id,
         esd.spec_vr_id,
         ssd.disposition,
         svr.control_lot_attrib_ind,
         svr.in_spec_lot_status_id,
         svr.out_of_spec_lot_status_id,
         s.organization_id
  FROM   gmd_sampling_events se,
         gmd_event_spec_disp esd,
         gmd_sample_spec_disp ssd,
         gmd_samples s,
         gmd_com_spec_vrs_vl svr
  WHERE  s.sample_id = p_sample_id
  AND    s.sampling_event_id = se.sampling_event_id
  AND    se.sampling_event_id = esd.sampling_event_id
  AND    esd.spec_used_for_lot_attrib_ind = 'Y'
  AND    esd.event_spec_disp_id = ssd.event_spec_disp_id
  AND    ssd.sample_id = s.sample_id
  AND    svr.spec_vr_id = esd.spec_vr_id
  AND    s.delete_mark = 0
  AND    esd.delete_mark = 0
  AND    ssd.delete_mark = 0
  ;
Line: 6463

  l_update_disp_rec      GMD_SAMPLES_GRP.update_disp_rec;
Line: 6483

  SELECT include_optional_test_rslt_ind
  FROM   gmd_quality_config
  WHERE  organization_id = p_org_id;
Line: 6566

      SELECT count(1)
      INTO   l_count_with_spec
      FROM   gmd_event_spec_disp esd, gmd_results r, gmd_spec_results sr,
             gmd_spec_tests_b st
      WHERE  esd.event_spec_disp_id = l_sample_rec.event_spec_disp_id
      AND    esd.event_spec_disp_id = sr.event_spec_disp_id
      AND    sr.result_id           = r.result_id
      AND    r.sample_id            = p_sample_id
      AND    (sr.evaluation_ind IS NULL OR
              sr.evaluation_ind    NOT IN ('0A', '4C', '5O', '1Z')
             )
      AND    r.delete_mark          = 0
      AND    sr.delete_mark         = 0
      AND    esd.spec_id = st.spec_id
      AND    st.test_id = r.test_id
      AND    ((l_include_optional = 'N' and st.optional_ind IS NULL) OR
              (l_include_optional = 'Y' and (r.result_value_num IS NOT NULL OR
	                                     r.result_value_char IS NOT NULL)
              )
             )
      ;
Line: 6593

      SELECT count(1)
      INTO   l_count_wo_spec
      FROM   gmd_results r, gmd_spec_results sr
      WHERE  sr.event_spec_disp_id = l_sample_rec.event_spec_disp_id
      AND    sr.result_id           = r.result_id
      AND    r.sample_id            = p_sample_id
      AND    sr.additional_test_ind = 'Y'
      AND    (sr.evaluation_ind IS NULL OR
              sr.evaluation_ind    NOT IN ('0A', '4C', '5O')
             )
      AND    r.delete_mark          = 0
      AND    sr.delete_mark         = 0
      ;
Line: 6655

        SELECT count(1)
        INTO   l_count_with_spec
        FROM   gmd_event_spec_disp esd, gmd_results r, gmd_spec_results sr,
               gmd_spec_tests_b st
        WHERE  esd.event_spec_disp_id = l_sample_rec.event_spec_disp_id
        AND    esd.event_spec_disp_id = sr.event_spec_disp_id
        AND    sr.result_id           = r.result_id
        AND    r.sample_id            = p_sample_id
        AND    (sr.evaluation_ind IS NULL OR
                sr.evaluation_ind    NOT IN ('0A', '1V', '4C', '5O', '1Z')
               )
        AND    r.delete_mark          = 0
        AND    sr.delete_mark         = 0
        AND    esd.spec_id = st.spec_id
        AND    st.test_id = r.test_id
        AND    ((l_include_optional = 'N' and st.optional_ind IS NULL) OR
                (l_include_optional = 'Y' and (r.result_value_num IS NOT NULL OR
	                                       r.result_value_char IS NOT NULL)
                )
               )
        ;
Line: 6683

        SELECT count(1)
        INTO   l_count_wo_spec
        FROM   gmd_results r, gmd_spec_results sr
        WHERE  sr.event_spec_disp_id = l_sample_rec.event_spec_disp_id
        AND    sr.result_id           = r.result_id
        AND    r.sample_id            = p_sample_id
        AND    sr.additional_test_ind = 'Y'
        AND    (sr.evaluation_ind IS NULL OR
                sr.evaluation_ind    NOT IN ('0A', '1V', '4C', '5O', '1Z')
               )
        AND    r.delete_mark          = 0
        AND    sr.delete_mark         = 0
        ;
Line: 6755

    l_update_disp_rec.sample_id               := p_sample_id;
Line: 6756

    l_update_disp_rec.event_spec_disp_id      := l_sample_rec.event_spec_disp_id;
Line: 6758

    l_update_disp_rec.no_of_samples_for_event := l_sample_rec.sample_req_cnt;
Line: 6760

    l_update_disp_rec.curr_disposition        := l_sample_rec.disposition;
Line: 6764

       gmd_debug.put_line ('  Call GMD_SAMPLES_GRP.update_sample_comp_disp '|| l_change_disp_to);
Line: 6767

    GMD_SAMPLES_GRP.update_sample_comp_disp(
                 p_update_disp_rec => l_update_disp_rec
               , p_to_disposition  => l_change_disp_to
               , x_return_status   => x_return_status
               , x_message_data    => l_message_data);
Line: 6784

    SELECT disposition
    INTO   l_disposition
    FROM   gmd_sampling_events
    WHERE  sampling_event_id = l_sample_rec.sampling_event_id
    ;
Line: 6858

  SELECT esd.disposition,
         svr.control_lot_attrib_ind,
         svr.in_spec_lot_status_id,
         svr.out_of_spec_lot_status_id,
         svr.organization_id
  FROM   gmd_event_spec_disp esd,
         gmd_com_spec_vrs_vl svr,
         gmd_composite_spec_disp csd
  WHERE  esd.event_spec_disp_id = p_event_spec_disp_id
  AND    esd.spec_used_for_lot_attrib_ind = 'Y'
  AND    svr.spec_vr_id = esd.spec_vr_id
  AND    esd.delete_mark = 0
  ;
Line: 6873

  SELECT transaction_reason_id
  FROM   gmd_quality_config
  WHERE  organization_id = p_organization_id
  AND    transaction_reason_id IS NOT NULL;
Line: 6884

  l_update_disp_rec              GMD_SAMPLES_GRP.update_disp_rec;
Line: 6922

  SELECT include_optional_test_rslt_ind
  FROM   gmd_quality_config
  WHERE  organization_id = p_org_id;
Line: 7043

        SELECT count(1)
        INTO   l_count_with_spec
        FROM   gmd_composite_spec_disp csd, gmd_event_spec_disp esd,
               gmd_composite_results cr, gmd_spec_tests_b st
        WHERE  csd.event_spec_disp_id = l_event_spec_disp_id
        AND    csd.latest_ind = 'Y'
        AND    csd.event_spec_disp_id = esd.event_spec_disp_id
        AND    csd.composite_spec_disp_id = cr.composite_spec_disp_id
        AND    cr.in_spec_ind IS NULL   -- Result is out-of-spec
        AND    st.spec_id = esd.spec_id
        AND    st.test_id = cr.test_id
        AND    ((l_include_optional = 'N' and st.optional_ind IS NULL) OR
                (l_include_optional = 'Y' and (cr.mean IS NOT NULL or cr.mode_char IS NOT NULL))
               )
        ;
Line: 7059

        SELECT count(1)
        INTO   l_count_wo_spec
        FROM   gmd_composite_spec_disp csd, gmd_event_spec_disp esd,
               gmd_composite_results cr
        WHERE  csd.event_spec_disp_id = l_event_spec_disp_id
        AND    csd.latest_ind = 'Y'
        AND    csd.event_spec_disp_id = esd.event_spec_disp_id
        AND    csd.composite_spec_disp_id = cr.composite_spec_disp_id
        AND    cr.in_spec_ind IS NULL                  -- Result is out-of-spec
        AND    cr.test_id NOT IN
               (SELECT st.test_id
                FROM   gmd_spec_tests_b st
                WHERE  st.spec_id = esd.spec_id)
        ;
Line: 7096

        SELECT composite_spec_disp_id
        INTO   l_composite_spec_disp_id
        FROM   gmd_composite_spec_disp csd
        WHERE  csd.event_spec_disp_id = l_event_spec_disp_id
        AND    csd.latest_ind = 'Y'
        ;
Line: 7105

        l_update_disp_rec.composite_spec_disp_id  := l_composite_spec_disp_id;
Line: 7106

        l_update_disp_rec.event_spec_disp_id      := l_event_spec_disp_id;
Line: 7107

        l_update_disp_rec.no_of_samples_for_event := l_sampling_event.sample_req_cnt;
Line: 7108

        l_update_disp_rec.sampling_event_id       := l_sampling_event.sampling_event_id;
Line: 7109

        l_update_disp_rec.curr_disposition        := l_spec_dtl.disposition;
Line: 7112

           gmd_debug.put_line ('  Call GMD_SAMPLES_GRP.update_sample_comp_disp '|| l_change_disp_to);
Line: 7115

        GMD_SAMPLES_GRP.update_sample_comp_disp(
                     p_update_disp_rec => l_update_disp_rec
                   , p_to_disposition  => l_change_disp_to
                   , x_return_status   => l_return_status
                   , x_message_data    => l_message_data);
Line: 7130

          SELECT organization_id
          INTO   l_organization_id
          FROM   gmd_samples
          WHERE  sampling_event_id = l_sampling_event.sampling_event_id
          AND    rownum = 1 ;
Line: 7148

          gmd_samples_grp.update_lot_grade_batch(       --nsrivast
                  p_sample_id           => NULL
                , p_composite_spec_disp_id  => l_composite_spec_disp_id
                , p_to_lot_status_id       => l_lot_status_id
                , p_from_lot_status_id       => NULL --l_lot_status_id
                , p_to_grade_code            => NULL
                , p_from_grade_code          => NULL
                , p_to_qc_status        => NULL
                , p_reason_id           => l_reason_id
                , p_hold_date           => NULL
                , x_return_status       => x_return_status
                , x_message_data        => l_message_data );
Line: 7196

PROCEDURE update_exptest_value_null
(p_exp_ref_test_id  IN gmd_qc_tests_b.test_id%TYPE
, p_sample_id IN gmd_samples.sample_id%TYPE
, p_event_spec_disp_id IN gmd_sample_spec_disp.event_spec_disp_id%TYPE
, x_return_status     OUT NOCOPY VARCHAR2
)
--Start of comments
--+========================================================================+
--| API Name    : update_exptest_value_null                                |
--| TYPE        : Group                                                    |
--| Notes       : This procedure takes the sample information and          |
--|               test_id, and updates the result of latest replicates     |
--|               of all the Expression tests of the current sample,       |
--|               which use the given test as dependent test, to NULL.     |              |
--|                                                                        |
--| HISTORY                                                                |
--|    Ravi Boddu     31-Dec-2004       Created.                           |
--|                                                                        |
--+========================================================================+
-- End of comments
IS
    l_rslt_tbl gmd_results_grp.rslt_tbl;
Line: 7223

   SELECT DISTINCT test_id
   FROM gmd_qc_test_values_b val
   WHERE  expression_ref_test_id = l_exp_ref_test_id ;
Line: 7231

    SELECT r.result_id
    FROM   gmd_results r, gmd_spec_results sr
    WHERE  r.result_id = sr.result_id
    AND    r.sample_id = l_sample_id
    AND    sr.event_spec_disp_id = l_event_spec_disp_id
    AND    NVL(sr.evaluation_ind, 'XX')  NOT IN ('50' ,'4C')
    AND    sr.delete_mark = 0
    AND    r.delete_mark = 0
    AND    r.test_id = l_test_id
    ORDER BY NVL(r.result_date,l_start_date) DESC , r.test_replicate_cnt DESC;
Line: 7245

    gmd_debug.put_line('Entering procedure update_exptest_value_null');
Line: 7256

        UPDATE gmd_results SET result_value_num = NULL WHERE result_id = l_result_id;
Line: 7262

    GMD_API_PUB.Log_Message('GMD_API_ERROR','PACKAGE','update_exptest_value_null','ERROR', SUBSTR(SQLERRM,1,100));
Line: 7265

  END update_exptest_value_null;