Do you really need the query of query? Why not just cfloop over the query:
<cfloop query="GetRecs"> <cfquery name="AddRecords" datasource="..."> INSERT INTO DetailTable (Id, SeqId, Qty, InvId) VALUES ('#GetRecs.Id#','#GetRecs.SeqId#','#GetRecs.Qty#','#GetRecs.InvId#') </cfquery> </cfloop> Greg Gorman UE WebOps Application Developer 913-624-8016 [EMAIL PROTECTED] -----Original Message----- From: kpurtell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 10, 2002 12:21 PM To: CF-List Subject: [KCFusion] Query of query not working Since we run CF5, I occasionally use the query-a-query feature. However the following code is not working. The first query runs just fine, but the query that follows either never runs or generates an error message "Insert not supported". As long as valid data is in the structure (query object) returned by the first query, shouldn't I be able to loop through that and insert the data into another table? <CFQUERY NAME="GetRecs" DATASOURCE="Database1"> SELECT Id, SeqId, Qty, InvId FROM WorkingTable WHERE Id = '#form.Id#' </CFQUERY> <CFLOOP FROM="1" TO="#GetRecs.RecordCount#" INDEX="i"> <CFQUERY DBTYPE="query" NAME="AddRecords"> INSERT INTO DetailTable (Id, SeqId, Qty, InvId) VALUES ('#GetRecs.Id[i]#','#GetRecs.SeqId[i]#','#GetRecs.Qty[i]#','#GetRecs.Inv Id[i ]#') </CFQUERY> </CFLOOP> Keith Purtell, Web/Network Administrator VantageMed Operations (Kansas City) Email: [EMAIL PROTECTED] CONFIDENTIALITY NOTICE: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. ______________________________________________________________________ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives........ http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe.................... mailto:[EMAIL PROTECTED] To Unsubscribe................ mailto:[EMAIL PROTECTED] ______________________________________________________________________ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives........ http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe.................... mailto:[EMAIL PROTECTED] To Unsubscribe................ mailto:[EMAIL PROTECTED]