Combining query rows in a loop

Posted by icemanind on Stack Overflow See other posts from Stack Overflow or by icemanind
Published on 2010-05-28T20:35:48Z Indexed on 2010/05/28 21:12 UTC
Read the original article Hit count: 227

Filed under:
|
|
|

I have the following ColdFusion 9 code:

<cfloop from="1" to="#arrayLen(tagArray)#" index="i">
    <cfquery name="qryGetSPFAQs" datasource="#application.datasource#">
        EXEC searchFAQ '#tagArray[i]#'
    </cfquery>
</cfloop>

The EXEC executes a stored procedure on the database server, which returns rows of data, depending on what the parameter is. What I am trying to do is combine the queries into one query object. In other words, if it loops 3 times and each loop returns 4 rows, I want a query object that has all 12 rows in one object. How do I acheive this?

© Stack Overflow or respective owner

Related posts about coldfusion

Related posts about cfml