If Site.EOF = "N1" Then
SQL1 = "SELECT PT_PART,PT_DESC1,PT_DESC2,CODE_CMMT,PT_PART_TYPE,PT_UM,PT_DRAW,PT_PROMO,PT_ARTICLE,PT_DSGN_GRP,PT_DRWG_LOC,PT_DRWG_SIZE,PT_PUR_LEAD FROM QAD.PT_MSTR left outer join QAD.CODE_MSTR on " & _
"upper(pt_domain)=upper(code_domain) and upper(PT_PART_TYPE) = upper(CODE_VALUE) and upper(CODE_FLDNAME) = 'PT_PART_TYPE' WHERE Upper (PT_DOMAIN) = '1000' and upper(PT_PART) like '" + Request.Form("m_pt_part") + "' and upper(PT_STATUS) <> 'RD' ORDER BY PT_PART"
Set RS1 = OraDatabase.DbCreateDynaset(SQL1,0)
Set FL1 = RS1.Fields
If RS1.EOF = True Then
Else
End if
%>
<%
If Site.EOF = "NAPK" Then
SQL1 = "SELECT PT_PART,PT_DESC1,PT_DESC2,CODE_CMMT,PT_PART_TYPE,PT_UM,PT_DRAW,PT_PROMO,PT_ARTICLE,PT_DSGN_GRP,PT_DRWG_LOC,PT_DRWG_SIZE,PT_PUR_LEAD FROM QAD.PT_MSTR left outer join QAD.CODE_MSTR on " & _
"upper(pt_domain)=upper(code_domain) and upper(PT_PART_TYPE) = upper(CODE_VALUE) and upper(CODE_FLDNAME) = 'PT_PART_TYPE' WHERE Upper (PT_DOMAIN) = '2000' and upper(PT_PART) like '" + Request.Form("m_pt_part") + "' and upper(PT_STATUS) <> 'RD' ORDER BY PT_PART"
Set RS1 = OraDatabase.DbCreateDynaset(SQL1,0)
Set FL1 = RS1.Fields
If RS1.EOF = True Then
Else
End if
%>
ผมมีคำถามต่อครับ ผมจะใช้ case when ยังไงครับ query นี้รันบน oracle แสดงผลได้ปกติ แต่พอเอามาใช้ใน asp ทำไมถึง error ครับ
query ใน asp ถ้าตัด case when ออกไป สามารถรันได้ปกติครับ พอใส่ case when เหมือนผมใส่ sysntax ไม่ถูกครับ
ใน oracle
SELECT ZEX_INV,ZEXP_PO,ZEXP_LINE,ZEXP_PART,ZEXP_QTY,ZEXP_EST_COST, CASE WHEN ZEX_DOMAIN = '1000' THEN '1000' WHEN ZEX_DOMAIN = '2000' THEN '2000' End
FROM qad.ZEX_MSTR,qad.ZEXP_DET
WHERE Upper (zex_domain) = Upper (zexp_domain) And Upper (ZEX_INV) = Upper (ZEXP_INV) and
Upper (ZEX_INV) Like 'KAG180300422'
ORDER BY ZEX_INV
asp Code (ASP)
SQL2 = "SELECT ZEX_INV,ZEXP_PO,ZEXP_LINE,ZEXP_PART,ZEXP_QTY,ZEXP_EST_COST, CASE WHEN ZEX_DOMAIN = '1000' THEN '1000' WHEN" & _ "ZEX_DOMAIN = '2000' THEN '2000' End" & _
"FROM qad.ZEX_MSTR,qad.ZEXP_DET" & _
"WHERE Upper (zex_domain) = Upper (zexp_domain) And Upper (ZEX_INV) = Upper (ZEXP_INV) and" & _
"Upper (ZEX_INV) Like '" & UCASE(Request("m_invoice1")) & "'" & _
"ORDER BY ZEX_INV"