[Home] [Help]
830:
831:
832:
833: -- following procedure is written to avoid code duplication.
834: -- qa_insp_plans_temp is being updated 3 times and this procedure
835: -- consolidates the code.
836: -- anagarwa Thu Oct 25 11:08:47 PDT 2001
837: procedure update_qa_insp_plans_temp(p_sample_size number,
838: p_c_num number,
833: -- following procedure is written to avoid code duplication.
834: -- qa_insp_plans_temp is being updated 3 times and this procedure
835: -- consolidates the code.
836: -- anagarwa Thu Oct 25 11:08:47 PDT 2001
837: procedure update_qa_insp_plans_temp(p_sample_size number,
838: p_c_num number,
839: p_rej_num number,
840: p_aql number,
841: p_coll_id number,
842: p_plan_id number)
843: is
844:
845: begin
846: update qa_insp_plans_temp
847: set sample_size = p_sample_size,
848: c_number = p_c_num,
849: rejection_number = p_rej_num,
850: aql = p_aql
850: aql = p_aql
851: where collection_id = p_coll_id
852: and plan_id = p_plan_id;
853:
854: end ; -- update_qa_insp_plans_temp
855:
856: --
857: -- local function
858: --
1030:
1031: cursor plan_cur
1032: is
1033: select plan_id
1034: from qa_insp_plans_temp qipt
1035: where collection_id = p_collection_id;
1036:
1037: --
1038: -- removed the rownum = 1 statement from this cursor
1137: -- End of Bug 7270226.FP for bug#7219703
1138:
1139: if (l_sampling_plan_id <> -1) --means sampling plan present
1140: then
1141: update qa_insp_plans_temp
1142: set sampling_plan_id = l_sampling_plan_id,
1143: sampling_criteria_id = l_criteria_id
1144: where collection_id = p_collection_id
1145: and plan_id = plan_rec.plan_id;
1151: where collection_id = p_collection_id;
1152:
1153: p_sampling_flag := 'Y'; --set out parameter
1154: else
1155: update qa_insp_plans_temp
1156: set sampling_plan_id = -1,
1157: sampling_criteria_id = -1
1158: where collection_id = p_collection_id
1159: and plan_id = plan_rec.plan_id;
1238: l_c_num := 0;
1239: l_rej_num := 1;
1240: l_aql := null;
1241:
1242: -- replace update stmt by calling proc update_qa_insp_plans_temp
1243: -- anagarwa Thu Oct 25 11:08:47 PDT 2001
1244: update_qa_insp_plans_temp(l_sample_size, l_c_num, l_rej_num,
1245: l_aql, p_collection_id,
1246: p_collection_plan_id);
1240: l_aql := null;
1241:
1242: -- replace update stmt by calling proc update_qa_insp_plans_temp
1243: -- anagarwa Thu Oct 25 11:08:47 PDT 2001
1244: update_qa_insp_plans_temp(l_sample_size, l_c_num, l_rej_num,
1245: l_aql, p_collection_id,
1246: p_collection_plan_id);
1247:
1248: /*
1245: l_aql, p_collection_id,
1246: p_collection_plan_id);
1247:
1248: /*
1249: update qa_insp_plans_temp
1250: set sample_size = l_sample_size,
1251: c_number = l_c_num,
1252: rejection_number = l_rej_num,
1253: aql = l_aql
1274: -- bhsankar Tue Jul 3 03:40:41 PDT 2007
1275: --
1276: l_sample_size := least(l_sample_size, p_lot_size);
1277:
1278: -- replace update stmt by calling proc update_qa_insp_plans_temp
1279: -- anagarwa Thu Oct 25 11:08:47 PDT 2001
1280: update_qa_insp_plans_temp(l_sample_size, l_c_num,
1281: l_rej_num, null, p_collection_id,
1282: p_collection_plan_id);
1276: l_sample_size := least(l_sample_size, p_lot_size);
1277:
1278: -- replace update stmt by calling proc update_qa_insp_plans_temp
1279: -- anagarwa Thu Oct 25 11:08:47 PDT 2001
1280: update_qa_insp_plans_temp(l_sample_size, l_c_num,
1281: l_rej_num, null, p_collection_id,
1282: p_collection_plan_id);
1283: /*
1284: update qa_insp_plans_temp
1280: update_qa_insp_plans_temp(l_sample_size, l_c_num,
1281: l_rej_num, null, p_collection_id,
1282: p_collection_plan_id);
1283: /*
1284: update qa_insp_plans_temp
1285: set sample_size = l_sample_size,
1286: c_number = l_c_num,
1287: rejection_number = l_rej_num,
1288: aql = null -- no aql for custom sampling
1310: -- reference bug 2331892
1311: --
1312: l_sample_size := least(l_sample_size, p_lot_size);
1313:
1314: -- replace update stmt by calling proc update_qa_insp_plans_temp
1315: -- anagarwa Thu Oct 25 11:08:47 PDT 2001
1316: update_qa_insp_plans_temp(l_sample_size, l_c_num,
1317: l_rej_num, l_aql, p_collection_id,
1318: p_collection_plan_id);
1312: l_sample_size := least(l_sample_size, p_lot_size);
1313:
1314: -- replace update stmt by calling proc update_qa_insp_plans_temp
1315: -- anagarwa Thu Oct 25 11:08:47 PDT 2001
1316: update_qa_insp_plans_temp(l_sample_size, l_c_num,
1317: l_rej_num, l_aql, p_collection_id,
1318: p_collection_plan_id);
1319: /*
1320: update qa_insp_plans_temp
1316: update_qa_insp_plans_temp(l_sample_size, l_c_num,
1317: l_rej_num, l_aql, p_collection_id,
1318: p_collection_plan_id);
1319: /*
1320: update qa_insp_plans_temp
1321: set sample_size = l_sample_size,
1322: c_number = l_c_num,
1323: rejection_number = l_rej_num,
1324: aql = l_aql
1383: cursor rej_cur
1384: is
1385: select c_number, rejection_number,
1386: sampling_plan_id, sampling_criteria_id
1387: from qa_insp_plans_temp
1388: where collection_id = p_collection_id
1389: and plan_id = p_coll_plan_id;
1390:
1391: cursor sampling_std_code_cur (x_sampling_plan_id number)
1484:
1485: reject_qty := nvl(reject_qty, 0);
1486:
1487: --set the total qty rejected for this collection plan
1488: update qa_insp_plans_temp
1489: set plan_rejected_qty = reject_qty
1490: where collection_id = p_collection_id
1491: and plan_id = p_coll_plan_id;
1492:
1516: result := 'FUZZY';
1517: end if;
1518: end if;
1519:
1520: update qa_insp_plans_temp
1521: set plan_insp_result = result
1522: where collection_id = p_collection_id
1523: and plan_id = p_coll_plan_id;
1524:
1552:
1553: cursor plan_result_cur
1554: is
1555: select count(*) AS rejected_plans
1556: from qa_insp_plans_temp
1557: where collection_id = p_collection_id
1558: and plan_insp_result = 'REJECT';
1559:
1560: cursor total_rej_cur
1559:
1560: cursor total_rej_cur
1561: is
1562: select sum(plan_rejected_qty) AS total_rej_qty
1563: from qa_insp_plans_temp
1564: where collection_id = p_collection_id;
1565:
1566: begin
1567: open sampling_flag_cur;
1643:
1644: cursor plan_count_cur
1645: is
1646: select count(*) AS insp_plans
1647: from qa_insp_plans_temp
1648: where collection_id = p_collection_id;
1649:
1650: l_plan_count NUMBER;
1651:
1676: -- This procedure supports unit wise inspection at lpn, lot and
1677: -- Serial levels.
1678: -- Bug 3096256. kabalakr Fri Aug 29 09:06:28 PDT 2003
1679:
1680: -- Check the no of plan involved from qa_insp_plans_temp.
1681: open plan_count_cur;
1682: fetch plan_count_cur into l_plan_count;
1683: close plan_count_cur;
1684:
2196: l_plan_id NUMBER;
2197:
2198: CURSOR plan_cur IS
2199: select plan_id
2200: from qa_insp_plans_temp
2201: where collection_id = p_collection_id;
2202:
2203:
2204: BEGIN