Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8697049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:25:18+00:00 2026-06-13T01:25:18+00:00

What I am trying to do is <cfloop array=#LOCAL.someArray index=LOCAL.aString> <cfset LOCAL.queryName = uniqueQueryName_

  • 0

What I am trying to do is

<cfloop array="#LOCAL.someArray" index="LOCAL.aString">

    <cfset LOCAL.queryName = "uniqueQueryName_" & LOCAL.aString />

    <cfquery name="#LOCAL.queryName#" datasource="db" cachedwithin="#CreateTimeSpan(1,0,0,0)#">
        SELECT count(*) AS c FROM someTable
    </cfquery>

    <cfdump var="#LOCAL.queryName#" />
</cfloop>

is this possible, or is there a better way to do it?

Edit

This works with <cfloop query="LOCAL.queryName"> but not when I try to do <cfset ArrayAppend(LOCAL.returnArray, LOCAL.queryName.c) />

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T01:25:19+00:00Added an answer on June 13, 2026 at 1:25 am

    There is no need to use evaluate() to do this, and one shouldn’t (so I’ve down-voted that answer, sorry).

    All you need to do is use associative array notation:

    <cfdump var="#local[qname]#">
    

    If one wants to access a column of that query, it’s:

    #local[qname][columnName]#
    

    And for a specific cell:

    #local[qname][columnName][rowNumber]#
    

    There are very very very few situations in which evaluate() is the correct answer to anything. One cannot rely on the Adobe docs because – unfortunately – an awful lot of it was not written by very experienced ColdFusion developers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following ColdFusion 9 code: <cfloop from=1 to=#arrayLen(tagArray)# index=i> <cfquery name=qryGetSPFAQs datasource=#application.datasource#>
I am trying to loop over motnhs like. <cfloop index=i from=05-2012 to=12-2012 step=#createTimeSpan(31, 0,
<CFIF ListLen(SESSION.WHSurveyStruct.reasonString, ;) gt 0> <CFQUERY name=insertReasons datasource=#REQUEST.dsn#> INSERT INTO TWelcomeHome_Reason (ReasonID, SubReasonID, SurveyID)
Trying to randomly generate one div from an array on each load of a
I'm trying to add the results of a loop to an array. Here is
Trying to use log4j's built-in JMSAppender to log messages to a local message queue
<cfoutput query=allOutcomes maxrows=10> <div class=galleryOutcome> <cfset thisPhoto = uploads.listPhotobyOutcomeID(#outcomeID#)> <h3>#lastname#, #firstname#</h3> <cfloop query=thisPhoto >
Trying to read registry keys remotly (from a host on local intranet)... All the
So I have this code: <!-- New Array for my loop --> <cfset filesArray
I am trying to use cfloop to loop form 0.0 to 5.0 but it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.