每次我加载某个页面时,它都会发出一个错误,说我试图除以零。经过检查,我们发现这只发生在我们的生产链接上,因为我们已经在本地 PC 上发布了它并且它工作得很好。以下是我们在页面上使用的查询:
SELECT DISTINCT *
FROM
(
SELECT c.containerid
,wldw.wafernumber "Wafer"
,wldd.wipdatavalue "Item Qty"
,iqty.wipdatavalue "Integrator Qty"
,nd.wipdatavalue "Net Die"
,tr.wipdatavalue "Total Rejects"
,vi.wipdatavalue "Visual Inspection"
,tpedispo.wipdatavalue "TPE Disposition"
,pa.wipdatavalue "Pre Align"
,pa.wipdatavalue "Post Visual"
, DECODE(NVL(iqty.wipdatavalue,0),0,0, ROUND((NVL(nd.wipdatavalue,0) / NVL(iqty.wipdatavalue,0)) * 100,2)) "Yield"
,comments.wipdatavalue "Comments"
,oper.wipdatavalue "Operator"
,pcwi.wipdatavalue "Inspector"
,engr.wipdatavalue "Engineer"
,wldw.waferstatus "Status"
,wl.wiplotid wiplothistoryid
,wl.wiptrackinggroupkeyid
,wl.specid
,wldw.wafersequence
,1 as withdrilldown
, gq.wipdatavalue WS_GROSSQTY
, gd.wipdatavalue WS_GOODDIE
, tq.wipdatavalue WS_TESTEDQTY
, wr.wipdatavalue WS_TOTALREJECTS
, vi.wipdatavalue WS_VISUALINSPECTION
, td.wipdatavalue WS_TPEDISPOSITION
, wc.wipdatavalue WS_COMMENTS
, oqa.wipdatavalue OQAREJECTTYPE
, wldd.wipdatanamename
FROM Container C
JOIN a_wiplot wl ON c.containerid = wl.containerid
JOIN a_wiplotdetails wld ON wl.wiplotid = wld.wiplotid
JOIN a_wiplotdetailswafers wldw ON wld.wiplotdetailsid = wldw.wiplotdetailsid
JOIN a_wiplotdetailsdata wldd ON wld.wiplotdetailsid = wldd.wiplotdetailsid AND wldd.waferscribenumber = wldw.waferscribenumber
LEFT JOIN a_wiplotdetailsdata nd ON wld.wiplotdetailsid = nd.wiplotdetailsid AND nd.waferscribenumber = wldw.waferscribenumber AND nd.wipdatanamename = 'WS_NET DIE'
LEFT JOIN a_wiplotdetailsdata iqty ON wld.wiplotdetailsid = iqty.wiplotdetailsid AND iqty.waferscribenumber = wldw.waferscribenumber AND iqty.wipdatanamename = 'WS_INTEGRATOR QTY'
LEFT JOIN a_wiplotdetailsdata tr ON wld.wiplotdetailsid = tr.wiplotdetailsid AND tr.waferscribenumber = wldw.waferscribenumber AND tr.wipdatanamename = 'WS_TOTAL REJECTS'
LEFT JOIN a_wiplotdetailsdata vi ON wld.wiplotdetailsid = vi.wiplotdetailsid AND vi.waferscribenumber = wldw.waferscribenumber AND vi.wipdatanamename = 'WS_VISUAL INSPECTION'
LEFT JOIN a_wiplotdetailsdata tpedispo ON wld.wiplotdetailsid = tpedispo.wiplotdetailsid AND tpedispo.waferscribenumber = wldw.waferscribenumber AND tpedispo.wipdatanamename = 'WS_TPE DISPOSITION'
LEFT JOIN a_wiplotdetailsdata pa ON wld.wiplotdetailsid = pa.wiplotdetailsid AND pa.waferscribenumber = wldw.waferscribenumber AND pa.wipdatanamename = 'WS_PRE ALIGN'
LEFT JOIN a_wiplotdetailsdata pv ON wld.wiplotdetailsid = pv.wiplotdetailsid AND pv.waferscribenumber = wldw.waferscribenumber AND pv.wipdatanamename = 'WS_POST VISUAL'
LEFT JOIN a_wiplotdetailsdata comments ON wld.wiplotdetailsid = comments.wiplotdetailsid AND comments.waferscribenumber = wldw.waferscribenumber AND comments.wipdatanamename = 'WS_COMMENTS'
LEFT JOIN a_wiplotdetailsdata oper ON wld.wiplotdetailsid = oper.wiplotdetailsid AND oper.waferscribenumber = wldw.waferscribenumber AND oper.wipdatanamename = 'WS_OPERATOR'
LEFT JOIN a_wiplotdetailsdata engr ON wld.wiplotdetailsid = engr.wiplotdetailsid AND engr.waferscribenumber = wldw.waferscribenumber AND engr.wipdatanamename = 'WS_ENGINEER'
LEFT JOIN a_wiplotdetailsdata pcwi ON wld.wiplotdetailsid = pcwi.wiplotdetailsid AND pcwi.waferscribenumber = wldw.waferscribenumber AND pcwi.wipdatanamename = 'WS_INSPECTOR'
LEFT JOIN a_wiplotdetailsdata gq ON wld.wiplotdetailsid = gq.wiplotdetailsid AND gq.waferscribenumber = wldw.waferscribenumber AND gq.wipdatanamename = 'WS_GROSS QTY'
LEFT JOIN a_wiplotdetailsdata gd ON wld.wiplotdetailsid = gd.wiplotdetailsid AND gd.waferscribenumber = wldw.waferscribenumber AND gd.wipdatanamename = 'WS_GOOD DIE'
LEFT JOIN a_wiplotdetailsdata tq ON wld.wiplotdetailsid = tq.wiplotdetailsid AND tq.waferscribenumber = wldw.waferscribenumber AND tq.wipdatanamename = 'WS_TESTED QTY/SAMPLE SIZE'
LEFT JOIN a_wiplotdetailsdata wr ON wld.wiplotdetailsid = wr.wiplotdetailsid AND wr.waferscribenumber = wldw.waferscribenumber AND wr.wipdatanamename = 'WS_TOTAL REJECTS'
LEFT JOIN a_wiplotdetailsdata vi ON wld.wiplotdetailsid = vi.wiplotdetailsid AND vi.waferscribenumber = wldw.waferscribenumber AND vi.wipdatanamename = 'WS_VISUAL INSPECTION'
LEFT JOIN a_wiplotdetailsdata td ON wld.wiplotdetailsid = td.wiplotdetailsid AND td.waferscribenumber = wldw.waferscribenumber AND td.wipdatanamename = 'WS_TPE DISPOSITION'
LEFT JOIN a_wiplotdetailsdata wc ON wld.wiplotdetailsid = wc.wiplotdetailsid AND wc.waferscribenumber = wldw.waferscribenumber AND wc.wipdatanamename = 'WS_COMMENTS'
LEFT JOIN a_wiplotdetailsdata oqa ON wld.wiplotdetailsid = oqa.wiplotdetailsid AND oqa.waferscribenumber = wldw.waferscribenumber AND oqa.wipdatanamename = 'FOR OQA_REJECT TYPE'
WHERE c.containername = :lotID AND wl.wiptrackinggroupkeyid = :ID AND wldd.iswaferdata = 1 AND wldd.wipdatanamename IN ('WS_ITEM QTY', 'WS_GROSS QTY')
UNION ALL
SELECT c.containerid
,wldw.wafernumber "Wafer"
,wldd.wipdatavalue "Item Qty"
,iqty.wipdatavalue "Integrator Qty"
,nd.wipdatavalue "Net Die"
,tr.wipdatavalue "Total Rejects"
,vi.wipdatavalue "Visual Inspection"
,tpedispo.wipdatavalue "TPE Disposition"
,pa.wipdatavalue "Pre Align"
,pa.wipdatavalue "Post Visual"
, DECODE(NVL(iqty.wipdatavalue,0),0,0, ROUND((NVL(nd.wipdatavalue,0) / NVL(iqty.wipdatavalue,0)) * 100,2)) "Yield"
,comments.wipdatavalue "Comments"
,oper.wipdatavalue "Operator"
,pcwi.wipdatavalue "Inspector"
,engr.wipdatavalue "Engineer"
,wldw.waferstatus "Status"
,wl.wiplothistoryid
,wl.wiptrackinggroupkeyid
,wl.specid
,wldw.wafersequence
,1 as withdrilldown
, gq.wipdatavalue WS_GROSSQTY
, gd.wipdatavalue WS_GOODDIE
, tq.wipdatavalue WS_TESTEDQTY
, wr.wipdatavalue WS_TOTALREJECTS
, vi.wipdatavalue WS_VISUALINSPECTION
, td.wipdatavalue WS_TPEDISPOSITION
, wc.wipdatavalue WS_COMMENTS
, oqa.wipdatavalue OQAREJECTTYPE
, wldd.wipdatanamename
FROM Container C
JOIN a_wiplothistory wl ON c.containerid = wl.containerid
JOIN a_wiplotdetailshistory wld ON wl.wiplothistoryid = wld.wiplothistoryid
JOIN a_wiplotdetailswafershistory wldw ON wld.wiplotdetailshistoryid = wldw.wiplotdetailshistoryid
JOIN a_wiplotdetailsdatahistory wldd ON wld.wiplotdetailshistoryid = wldd.wiplotdetailshistoryid AND wldd.waferscribenumber = wldw.waferscribenumber
LEFT JOIN a_wiplotdetailsdatahistory nd ON wld.wiplotdetailshistoryid = nd.wiplotdetailshistoryid AND nd.waferscribenumber = wldw.waferscribenumber AND nd.wipdatanamename = 'WS_NET DIE'
LEFT JOIN a_wiplotdetailsdatahistory iqty ON wld.wiplotdetailshistoryid = iqty.wiplotdetailshistoryid AND iqty.waferscribenumber = wldw.waferscribenumber AND iqty.wipdatanamename = 'WS_INTEGRATOR QTY'
LEFT JOIN a_wiplotdetailsdatahistory tr ON wld.wiplotdetailshistoryid = tr.wiplotdetailshistoryid AND tr.waferscribenumber = wldw.waferscribenumber AND tr.wipdatanamename = 'WS_TOTAL REJECTS'
LEFT JOIN a_wiplotdetailsdatahistory vi ON wld.wiplotdetailshistoryid = vi.wiplotdetailshistoryid AND vi.waferscribenumber = wldw.waferscribenumber AND vi.wipdatanamename = 'WS_VISUAL INSPECTION'
LEFT JOIN a_wiplotdetailsdatahistory tpedispo ON wld.wiplotdetailshistoryid = tpedispo.wiplotdetailshistoryid AND tpedispo.waferscribenumber = wldw.waferscribenumber AND tpedispo.wipdatanamename = 'WS_TPE DISPOSITION'
LEFT JOIN a_wiplotdetailsdatahistory pa ON wld.wiplotdetailshistoryid = pa.wiplotdetailshistoryid AND pa.waferscribenumber = wldw.waferscribenumber AND pa.wipdatanamename = 'WS_PRE ALIGN'
LEFT JOIN a_wiplotdetailsdatahistory pv ON wld.wiplotdetailshistoryid = pv.wiplotdetailshistoryid AND pv.waferscribenumber = wldw.waferscribenumber AND pv.wipdatanamename = 'WS_POST VISUAL'
LEFT JOIN a_wiplotdetailsdatahistory comments ON wld.wiplotdetailshistoryid = comments.wiplotdetailshistoryid AND comments.waferscribenumber = wldw.waferscribenumber AND comments.wipdatanamename = 'WS_COMMENTS'
LEFT JOIN a_wiplotdetailsdatahistory oper ON wld.wiplotdetailshistoryid = oper.wiplotdetailshistoryid AND oper.waferscribenumber = wldw.waferscribenumber AND oper.wipdatanamename = 'WS_OPERATOR'
LEFT JOIN a_wiplotdetailsdatahistory engr ON wld.wiplotdetailshistoryid = engr.wiplotdetailshistoryid AND engr.waferscribenumber = wldw.waferscribenumber AND engr.wipdatanamename = 'WS_ENGINEER'
LEFT JOIN a_wiplotdetailsdatahistory pcwi ON wld.wiplotdetailshistoryid = pcwi.wiplotdetailshistoryid AND pcwi.waferscribenumber = wldw.waferscribenumber AND pcwi.wipdatanamename = 'WS_INSPECTOR'
LEFT JOIN a_wiplotdetailsdatahistory gq ON wld.wiplotdetailshistoryid = gq.wiplotdetailshistoryid AND gq.waferscribenumber = wldw.waferscribenumber AND gq.wipdatanamename = 'WS_GROSS QTY'
LEFT JOIN a_wiplotdetailsdatahistory gd ON wld.wiplotdetailshistoryid = gd.wiplotdetailshistoryid AND gd.waferscribenumber = wldw.waferscribenumber AND gd.wipdatanamename = 'WS_GOOD DIE'
LEFT JOIN a_wiplotdetailsdatahistory tq ON wld.wiplotdetailshistoryid = tq.wiplotdetailshistoryid AND tq.waferscribenumber = wldw.waferscribenumber AND tq.wipdatanamename = 'WS_TESTED QTY/SAMPLE SIZE'
LEFT JOIN a_wiplotdetailsdatahistory wr ON wld.wiplotdetailshistoryid = wr.wiplotdetailshistoryid AND wr.waferscribenumber = wldw.waferscribenumber AND wr.wipdatanamename = 'WS_TOTAL REJECTS'
LEFT JOIN a_wiplotdetailsdatahistory vi ON wld.wiplotdetailshistoryid = vi.wiplotdetailshistoryid AND vi.waferscribenumber = wldw.waferscribenumber AND vi.wipdatanamename = 'WS_VISUAL INSPECTION'
LEFT JOIN a_wiplotdetailsdatahistory td ON wld.wiplotdetailshistoryid = td.wiplotdetailshistoryid AND td.waferscribenumber = wldw.waferscribenumber AND td.wipdatanamename = 'WS_TPE DISPOSITION'
LEFT JOIN a_wiplotdetailsdatahistory wc ON wld.wiplotdetailshistoryid = wc.wiplotdetailshistoryid AND wc.waferscribenumber = wldw.waferscribenumber AND wc.wipdatanamename = 'WS_COMMENTS'
LEFT JOIN a_wiplotdetailsdatahistory oqa ON wld.wiplotdetailshistoryid = oqa.wiplotdetailshistoryid AND oqa.waferscribenumber = wldw.waferscribenumber AND oqa.wipdatanamename = 'FOR OQA_REJECT TYPE'
WHERE c.containername = :lotID AND wl.wiptrackinggroupkeyid = :ID AND wldd.iswaferdata = 1 AND wldd.wipdatanamename IN ('WS_ITEM QTY', 'WS_GROSS QTY')
) wd
ORDER BY wd."Wafer", wd.wafersequence
而且,背后的代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net;
namespace CamstarReportPortal.WebForms.MAXIMDataCollection.WaferSortMaxCIM
{
public partial class MaxCIMWSTesterSummary : System.Web.UI.Page
{
static String wipkey;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
txtLot.Text = Request.QueryString["lotID"].ToString();
txtSpec.Text = Request.QueryString["specname"].ToString();
txtWipKey.Text = Request.QueryString["ID"].ToString();
wipkey = Session["ID"].ToString();
uwgDataCollection.DataSourceID = whdsDataCollection.ID;
uwgDataCollection.DataBind();
uwgDataCollection.ExpandAll();
CustomizeColumns(txtSpec.Text.Substring(0, 4));
ExpirePageCache();
}
if (ddlInsertion.Items.FindByValue("%") != null)
{
//DO NOTHING
}
else
{
ddlInsertion.Items.Insert(0, new System.Web.UI.WebControls.ListItem("All", "%"));
}
}
public void CustomizeColumns(string opCode)
{
if (uwgDataCollection.Bands.Count > 1)
{
switch (opCode)
{
case "8628":
case "8337":
case "8622":
{
this.uwgDataCollection.Bands[1].Columns[3].Hidden = true;//Sample Size
this.uwgDataCollection.Bands[1].Columns[4].Hidden = false;//Tester Summary
this.uwgDataCollection.Bands[1].Columns[5].Hidden = false;//IGS Qty
this.uwgDataCollection.Bands[1].Columns[6].Hidden = false;//Total Rejects
this.uwgDataCollection.Bands[1].Columns[7].Hidden = false;//Yield
this.uwgDataCollection.Bands[1].Columns[8].Hidden = false;//Variance
this.uwgDataCollection.Bands[1].Columns[9].Hidden = true;//QA Test Result
this.uwgDataCollection.Bands[1].Columns[10].Hidden = false;//Probemark Inspection
this.uwgDataCollection.Bands[1].Columns[11].Hidden = false;//Remarks
this.uwgDataCollection.Bands[1].Columns[12].Hidden = true;//Remarks2
this.uwgDataCollection.Bands[1].Columns[13].Hidden = false;//Operator
this.uwgDataCollection.Bands[1].Columns[14].Hidden = false;//Engineer
this.uwgDataCollection.Bands[1].Columns[15].Hidden = false;//Bin Failure
this.uwgDataCollection.Bands[1].Columns[16].Hidden = false;//Mismatch Disposition
this.uwgDataCollection.Bands[1].Columns[17].Hidden = true;//Yield Disposition
this.uwgDataCollection.Bands[1].Columns[18].Hidden = true;//Reject Disposition
this.uwgDataCollection.Bands[1].Columns[19].Hidden = false;//WAFERSTATUS
this.uwgDataCollection.Bands[1].Columns[20].Hidden = true;//Elect. Rejects @ 8628
this.uwgDataCollection.Bands[1].Columns[21].Hidden = false;//Adjustment Qty
if (opCode == "8622")
{
this.uwgDataCollection.Bands[1].Columns[16].Hidden = true;//Mismatch Disposition
this.uwgDataCollection.Bands[1].Columns[18].Hidden = false;//Reject Disposition
}
break;
}
case "7628":
case "7337":
case "7629":
case "8537":
{
this.uwgDataCollection.Bands[1].Columns[3].Hidden = false;//Sample Size
this.uwgDataCollection.Bands[1].Columns[4].Hidden = false;//Tester Summary
this.uwgDataCollection.Bands[1].Columns[5].Hidden = false;//IGS Qty
this.uwgDataCollection.Bands[1].Columns[6].Hidden = false;//Total Rejects
this.uwgDataCollection.Bands[1].Columns[7].Hidden = false;//Yield
this.uwgDataCollection.Bands[1].Columns[8].Hidden = false;//Variance
this.uwgDataCollection.Bands[1].Columns[9].Hidden = false;//QA Test Result
this.uwgDataCollection.Bands[1].Columns[10].Hidden = true;//Probemark Inspection
this.uwgDataCollection.Bands[1].Columns[11].Hidden = false;//Remarks
this.uwgDataCollection.Bands[1].Columns[12].Hidden = true;//Remarks2
this.uwgDataCollection.Bands[1].Columns[13].Hidden = false;//Operator
this.uwgDataCollection.Bands[1].Columns[14].Hidden = false;//Engineer
this.uwgDataCollection.Bands[1].Columns[15].Hidden = false;//Bin Failure
this.uwgDataCollection.Bands[1].Columns[16].Hidden = true;//Mismatch Disposition
this.uwgDataCollection.Bands[1].Columns[17].Hidden = false;//Yield Disposition
this.uwgDataCollection.Bands[1].Columns[18].Hidden = false;//Reject Disposition
this.uwgDataCollection.Bands[1].Columns[19].Hidden = false;//WAFERSTATUS
this.uwgDataCollection.Bands[1].Columns[20].Hidden = false;//Elect. Rejects @ 8628
this.uwgDataCollection.Bands[1].Columns[21].Hidden = false;//Adjustment Qty
if (opCode == "8537")
{
this.uwgDataCollection.Bands[1].Columns[15].Hidden = true;//Bin Failure
this.uwgDataCollection.Bands[1].Columns[16].Hidden = false;//Mismatch Disposition
this.uwgDataCollection.Bands[1].Columns[10].Hidden = true;//Probemark Inspection
this.uwgDataCollection.Bands[1].Columns[9].Hidden = true;//QA Test Result
this.uwgDataCollection.Bands[1].Columns[18].Hidden = true;//Reject Disposition
}
if (opCode == "7628")
{
this.uwgDataCollection.Bands[1].Columns[17].Hidden = true;//Yield Disposition
}
break;
}
case "6103":
{
this.uwgDataCollection.Bands[1].Columns[1].Hidden = true;//Integrator Qty
this.uwgDataCollection.Bands[1].Columns[2].Hidden = true;//Net Die
this.uwgDataCollection.Bands[1].Columns[3].Hidden = true;//Total Rejects
this.uwgDataCollection.Bands[1].Columns[4].Hidden = true;//Visual Inspection
this.uwgDataCollection.Bands[1].Columns[5].Hidden = true;//TPE Dispo
this.uwgDataCollection.Bands[1].Columns[6].Hidden = true;//Pre Align
this.uwgDataCollection.Bands[1].Columns[7].Hidden = true;//Post Visual
this.uwgDataCollection.Bands[1].Columns[8].Hidden = true;//Yield
this.uwgDataCollection.Bands[1].Columns[9].Hidden = true;//Comment
this.uwgDataCollection.Bands[1].Columns[10].Hidden = true;//Operator
this.uwgDataCollection.Bands[1].Columns[11].Hidden = true;//Inspector
this.uwgDataCollection.Bands[1].Columns[12].Hidden = true;//Engineer
this.uwgDataCollection.Bands[1].Columns[13].Hidden = true;//Status
this.uwgDataCollection.Bands[1].Columns[14].Hidden = false;//WS Gross Qty
this.uwgDataCollection.Bands[1].Columns[15].Hidden = false;//WS Good Die
this.uwgDataCollection.Bands[1].Columns[16].Hidden = false;//WS Tested Qty
this.uwgDataCollection.Bands[1].Columns[17].Hidden = false;//WS Total Rejects
this.uwgDataCollection.Bands[1].Columns[18].Hidden = false;//WS Visual Inspection
this.uwgDataCollection.Bands[1].Columns[19].Hidden = false;//WS TPE Dispo
this.uwgDataCollection.Bands[1].Columns[20].Hidden = false;//WS Comments
this.uwgDataCollection.Bands[1].Columns[21].Hidden = false;//OQ Reject Type
break;
}
default:
{
this.uwgDataCollection.Bands[1].Columns[14].Hidden = true;//WS Gross Qty
this.uwgDataCollection.Bands[1].Columns[15].Hidden = true;//WS Good Die
this.uwgDataCollection.Bands[1].Columns[16].Hidden = true;//WS Tested Qty
this.uwgDataCollection.Bands[1].Columns[17].Hidden = true;//WS Total Rejects
this.uwgDataCollection.Bands[1].Columns[18].Hidden = true;//WS Visual Inspection
this.uwgDataCollection.Bands[1].Columns[19].Hidden = true;//WS TPE Dispo
this.uwgDataCollection.Bands[1].Columns[20].Hidden = true;//WS Comments
this.uwgDataCollection.Bands[1].Columns[21].Hidden = true;//OQ Reject Type
break;
}
};
}
}
private void ExpirePageCache()
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(DateTime.Now - new TimeSpan(1, 0, 0));
Response.Cache.SetLastModified(DateTime.Now);
Response.Cache.SetAllowResponseInBrowserHistory(false);
}
protected void ddlInsertion_SelectedIndexChanged(object sender, EventArgs e)
{
string value = ddlInsertion.SelectedItem.Value.ToString();
if (ddlInsertion.SelectedItem.Value.ToString() == "All")
{
uwgDataCollection.DataSourceID = whdsDataCollection.ID;
uwgDataCollection.DataBind();
uwgDataCollection.ExpandAll();
CustomizeColumns(txtSpec.Text.Substring(0, 4));
ExpirePageCache();
}
else
{
uwgDataCollection.DataSourceID = whdsDataCollectionAPB.ID;
uwgDataCollection.DataBind();
uwgDataCollection.ExpandAll();
CustomizeColumns(txtSpec.Text.Substring(0, 4));
ExpirePageCache();
}
}
}
}
我们确保在查询中正确处理除以零错误,并且我们对后面的代码没有任何计算。谢谢大家的帮助。