open c1;
loop
fetch c1 into r1;
exit when c1%notfound;
V_ROW := V_ROW + 1;
----
DDE.Poke(ConvID, 'R' || V_ROW || 'C' || 1, nvl(:MASTER.WEEK,' ') , DDE.CF_TEXT, 1000);
DDE.Poke(ConvID, 'R' || V_ROW || 'C' || 2, nvl(R1.V_INSPECT_DATE,' ') , DDE.CF_TEXT, 1000);
DDE.Poke(ConvID, 'R' || V_ROW || 'C' || 3, nvl(v_FTY,' ') , DDE.CF_TEXT, 1000);
DDE.Poke(ConvID, 'R' || V_ROW || 'C' || 4, nvl(R1.V_SEWLINE,' ') , DDE.CF_TEXT, 1000);
DDE.Poke(ConvID, 'R' || V_ROW || 'C' || 5, nvl(R1.V_NAME,' ') , DDE.CF_TEXT, 1000);
DDE.Poke(ConvID, 'R' || V_ROW || 'C' || 6, nvl(R1.V_CUNM,' ') , DDE.CF_TEXT, 1000);
DDE.Poke(ConvID, 'R' || V_ROW || 'C' || 7, nvl(R1.V_STYLE,' ') , DDE.CF_TEXT, 1000);
DDE.Poke(ConvID, 'R' || V_ROW || 'C' || 8, nvl(R1.V_INSPECT_QTY,' ') , DDE.CF_TEXT, 1000);
v_Pass := R1.V_INSPECT_QTY-R1.V_REJECT_QTY;
DDE.Poke(ConvID, 'R' || V_ROW || 'C' || 9, nvl(v_Pass,' ') , DDE.CF_TEXT, 1000);
DDE.Poke(ConvID, 'R' || V_ROW || 'C' || 10, nvl(R1.V_REJECT_QTY,' ') , DDE.CF_TEXT, 1000);
DDE.Poke(ConvID, 'R' || V_ROW || 'C' || 12, nvl(R1.V_DEFECT_QTY,' ') , DDE.CF_TEXT, 1000);
v_Passpercent := v_Pass / R1.V_INSPECT_QTY;
DDE.Poke(ConvID, 'R' || V_ROW || 'C' || 13, nvl(v_Passpercent,' ') , DDE.CF_TEXT, 1000);
BEGIN
For X IN 1..32 Loop
SELECT
D.DEFECT_QTY INTO v_Total
FROM
QASYS.QC_INSPECT_DEFECT D
WHERE D.SUB_DEFECT_ID = v_sub_Defect(X)
AND D.INSPECT_HEADER_ID = R1.V_INSPECT_HEADER_ID;
EXCEPTION
WHEN NO_DATA_FOUND THEN
v_sub_Defect(X) :=0;
END
V_COL3 := V_COL3 + 1;
DDE.Poke(ConvID, 'R' || V_ROW || 'C' || V_COL3,nvl(v_Total,' ') , DDE.CF_TEXT, 1000);
DDE.Poke(ConvID, 'R' || 19 || 'C' || V_COL3,nvl(v_sub_Defect(X),' ') , DDE.CF_TEXT, 1000);
v_Total:=0;
END Loop;
V_COL3 := 18;
END;
v_Pass := 0;
v_Passpercent := 0;
----
synchronize;
end loop;
close c1;