Did you then query the newly created query to printout your data? Also, I'd be interested in how you created the new query with a loop. I am not sure how to do that.
Main Topics
Browse All TopicsNot 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
<TR><TD>
<TABLE WIDTH="670" BGCOLOR="white" BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR CLASS="userinfo">
<TD ALIGN="left" WIDTH="25"><strong>Line</s
<TD ALIGN="left"> </TD>
<TD ALIGN="left"><strong>Produ
</TR>
<TR>
<TD colspan="13" style="border-top: 2 solid green; font-size:2px"> </TD>
</TR>
<cfloop query="qryOrdDetail">
<TR>
<TD ALIGN="left">#qryOrdDetail
<TD ALIGN="left"> </TD>
<TD ALIGN="left">#qryOrdDetail
</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
<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="right">#NumberForma
<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>
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
We had a similar issue as well, and the way we (think) it was solved was by surrounding the value in single quotes:
<cfquery name="qryShipments" dbtype="query">
Select *
From qryShpDetail
Where LINEN3 = '#qryOrdDetail.LINEN2#'
</cfquery>
It appears that QofQ doesn't really care if numeric values are in quotes. Anyway, it's worth a shot.
-Dain
Dain, interesting idea. I think I tried that and it didn't work, but I can't be sure as it was awhile ago and I don't have access to that as it has since been re-written to a totally different method.
sulzener, Here is some sample code:
<cfset qryShipments = QueryNew("col1,col2,col3,e
<cfloop query="qryShpDetail">
<cfif LINEN3 EQ qryOrdDetail.LINEN2>
<cfset QueryAddRow(qryShipments)>
<cfset QuerySetCell(qryShipments,
<cfset QuerySetCell(qryShipments,
<cfset QuerySetCell(qryShipments,
</cfif>
</cfloop>
Then you can use qryShipments as a query in the rest of the code.
The main drawback is having to specify each column - you can't use * in this method
I cant post the custum tag because it is copyrighted by an outside company, but I did build new queries from the returned queries just to see if I could bypass the error. I still get the same error. I played around and tried to load the new queries with non-stringed LINE NUMBERS (LINEN2, LINEN3). This is so bizzare. I have posted the modifed code below:
<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 --->
<CF_SELECT SUCCESS="yesOrdDetail" ERRORS="noOrdDetail" QUERY="qryOrdDetail">
SELECT ORDNO, LINEN2, PRDNO, QTYORD, QTYSHP
FROM #tblOrdDetail#
WHERE ORDNO = #Session.OH.ORDNO#
</CF_SELECT>
<cfif yesOrdDetail and ISQUERY(qryOrdDetail)>
<CFSET LoopCount=1>
<cfset session.OD = QueryNew("LINEN2, PRDNO, QTYORD, QTYSHP")>
<CFLOOP QUERY="qryOrdDetail">
<cfset temp = QueryAddRow(session.OD)>
<cfset temp = QuerySetCell(session.OD,"L
<cfset temp = QuerySetCell(session.OD,"P
<cfset temp = QuerySetCell(session.OD,"Q
<cfset temp = QuerySetCell(session.OD,"Q
<CFSET #LoopCount#=#LoopCount#+1>
</CFLOOP>
</cfif>
<cfif session.ShowShipments IS 'Y'>
<CF_SELECT SUCCESS="yesShpDetail" ERRORS="noShpDetail" QUERY="qryShpDetail">
SELECT ORDNO, LINEN3, SSTAT, SEQNO, QTYSHP, SHPDT, LOT4D AS ROLLNO
FROM #tblShpDetail#
WHERE (ORDNO = #Session.OH.ORDNO#) and (SSTAT = 'N' or SSTAT = 'S')
</CF_SELECT>
<cfif yesShpDetail and ISQUERY(qryShpDetail)>
<CFSET LoopCount=1>
<cfset session.SD = QueryNew("ORDNO,LINEN3,SST
<CFLOOP QUERY="qryShpDetail">
<cfset temp = QueryAddRow(session.SD)>
<cfset temp = QuerySetCell(session.SD,"O
<cfset temp = QuerySetCell(session.SD,"L
<cfset temp = QuerySetCell(session.SD,"S
<cfset temp = QuerySetCell(session.SD,"S
<cfset temp = QuerySetCell(session.SD,"Q
<cfset temp = QuerySetCell(session.SD,"S
<cfset temp = QuerySetCell(session.SD,"R
<CFSET #LoopCount#=#LoopCount#+1>
</CFLOOP>
</cfif>
</cfif>
<cfif ISQUERY(session.OD)>
<TABLE WIDTH="670" BGCOLOR="#Session.bgHeader
<TR><TD>
<TABLE WIDTH="670" BGCOLOR="white" BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR CLASS="userinfo">
<TD ALIGN="left" WIDTH="25"><strong>Line</s
<TD ALIGN="left"> </TD>
<TD ALIGN="left"><strong>Produ
<TD ALIGN="right"><strong>Orde
<TD ALIGN="right"><strong>Ship
</TR>
<TR>
<TD colspan="13" style="border-top: 2 solid green; font-size:2px"> </TD>
</TR>
<cfloop query="qryOrdDetail">
<TR>
<TD ALIGN="left">#session.OD.L
<TD ALIGN="left"> </TD>
<TD ALIGN="left">#session.OD.P
<TD ALIGN="right">#NumberForma
<TD ALIGN="right">#NumberForma
</TR>
<cfif session.ShowShipments IS 'Y'>
<cfif ISQUERY(session.SD)>
<TR>
<TD colspan="20">
<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
<TD ALIGN="right"></TD>
</TR>
<cfquery name="qryShipments" dbtype="query">
Select *
From session.SD
Where LINEN3 = #session.OD.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#<c
<TD ALIGN="left"> </TD>
<TD ALIGN="left">#DateFormat(q
<TD ALIGN="right">#NumberForma
<TD ALIGN="right"></TD>
</TR>
</cfloop>
</TABLE>
</TD>
</TR>
<cfelse>
<TR>
<TD colspan="20">
<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>
I am wondering is someone could comment on my last post? After puttingthe data into totally different queries, the error still occurs. I am wondering if someone could even help me figure out how to determine ifa specific field might be causing the error? Is it the WHERE clause? At this point I'm stumped.
Business Accounts
Answer for Membership
by: mrichmonPosted on 2005-05-17 at 11:26:59ID: 14021270
I had that problem before - in one situation (almost identical to yours above) I could not get around it with Query of Queries.
Macromedia was no help either.
I had to have a loop and manually go through the query creating a new query by hand instead of using a query of queries....