Not sure if anyone can help me on this unless they can see the dump of the data, but I will try. I have a Custom Tag that retrieves data from a secured external DB. It returns the requested data back in the form of a query. I then do a Query of Query to display the info in the needed format. This works 90% of the time but every now an then I get the QofQ runtime error when trying to query over the returned data. When I CFDUMP the returned (qryShpDetail), it looks exactly like it should. Can anytime spot a problem?
<!--- Query Of Queries runtime error. - Can't convert the string to java type DOUBLE --->
<cfoutput>
<cfset Session.OH.ORDNO = 123456>
<cfset Session.bgHeader = 'green'>
<cfset Session.ShowShipments = 'Y'>
<!--- CF_SELECT is a custom tag to retrieve data from external db. It returns data in query form --->
<CF_SELECT SUCCESS="yesOrdDetail" ERRORS="noOrdDetail" QUERY="qryOrdDetail">
SELECT ORDNO, LINEN2, PRDNO, QTYORD, QTYSHP
FROM #tblOrdDetail#
WHERE ORDNO = #Session.OH.ORDNO#
</CF_SELECT>
<cfif session.ShowShipments IS 'Y'>
<CF_SELECT SUCCESS="yesShpDetail" ERRORS="noShpDetail" QUERY="qryShpDetail">
SELECT ORDNO, LINEN3, SSTAT, SEQNO, QTYSHP, SHPDT, ROLLNO
FROM #tblShpDetail#
WHERE (ORDNO = #Session.OH.ORDNO#) and (SSTAT = 'N' or SSTAT = 'S')
</CF_SELECT>
</cfif>
<cfif yesOrdDetail>
<TABLE WIDTH="670" BGCOLOR="#Session.bgHeader
#" BORDER="0" CELLPADDING="0" CELLSPACING="1">
<TR><TD>
<TABLE WIDTH="670" BGCOLOR="white" BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR CLASS="userinfo">
<TD ALIGN="left" WIDTH="25"><strong>Line</s
trong></TD
>
<TD ALIGN="left"> </TD>
<TD ALIGN="left"><strong>Produ
ct</strong
></TD> <TD ALIGN="right"><strong>Orde
red</stron
g></TD> <TD ALIGN="right"><strong>Ship
ped</stron
g></TD>
</TR>
<TR>
<TD colspan="13" style="border-top: 2 solid green; font-size:2px"> </TD>
</TR>
<cfloop query="qryOrdDetail">
<TR>
<TD ALIGN="left">#qryOrdDetail
.LINEN2#</
TD>
<TD ALIGN="left"> </TD>
<TD ALIGN="left">#qryOrdDetail
.PRDNO#</T
D> <TD ALIGN="right">#NumberForma
t(qryOrdDe
tail.QTYOR
D, ",___")#</TD> <TD ALIGN="right">#NumberForma
t(qryOrdDe
tail.QTYSH
P, ",___")#</TD>
</TR>
<cfif session.ShowShipments IS 'Y'>
<cfif yesShpDetail>
<TR>
<TD colspan="5">
<TABLE WIDTH=100% BORDER="0" CELLPADDING="0" CELLSPACING="1">
<TR>
<TD WIDTH="25"> </TD>
<TD ALIGN="left"> </TD> <TD WIDTH="70" ALIGN="left"><strong>Roll No.</strong></TD>
<TD ALIGN="left"> </TD> <TD ALIGN="left"><strong>Ship Date</strong></TD>
<TD ALIGN="right"><strong>Ship
Qty</strong></TD>
<TD ALIGN="right"></TD>
</TR>
<!--- <CFDUMP VAR=#qryOrdDetail#/><br> --->
<!--- <CFDUMP VAR=#qryShpDetail#/><br> --->
<!--- <cfabort> --->
<!--- THIS IS THE QUERY THAT BOMBS --->
<cfquery name="qryShipments" dbtype="query">
Select *
From qryShpDetail
Where LINEN3 = #qryOrdDetail.LINEN2#
</cfquery>
<cfloop query="qryShipments">
<TR>
<TD WIDTH="25"> </TD>
<TD ALIGN="left"> </TD> <TD WIDTH="70" ALIGN="left">
<cfif trim(qryShipments.ROLLNO) IS NOT "">#qryShipments.ROLLNO#
<cfelse> </cfif></TD>
<TD ALIGN="left"> </TD> <TD ALIGN="left">#DateFormat(q
ryShipment
s.SHPDT, "mm/dd/yy")#</TD>
<TD ALIGN="right">#NumberForma
t(qryShipm
ents.QTYSH
P, ",___")#</TD>
<TD ALIGN="right"></TD> </TR>
</cfloop>
</TABLE>
</TD>
</TR>
<cfelse>
<TR>
<TD colspan="5">
<TABLE WIDTH=100% BORDER="0" CELLPADDING="0" CELLSPACING="1">
<TR>
<TD ALIGN="left">Shipment lines do not exist for this order.</TD> <TD ALIGN="right"></TD> </TR>
</TABLE>
</TD>
</TR>
</cfif>
</cfif>
</cfloop>
</TABLE>
</TD></TR>
</TABLE>
<cfelse>
No order lines for #Session.OH.ORDNO#<br>
</cfif>
</cfoutput>
View the Solution FREE for 7 Days