I know this was nearly a month ago, but I'm just getting caught up.

You know you can use CFSET to update a query?

<cfset queryName.fieldname[rownum] = newvalue>
Often I have to add info to a query so I add some "dummy" fields in the 
select statement:

Here's some sort-of code to show you:

<cfquery name="x">
SELECT fieldA, fieldB, '' as newFieldC, '' as newFieldD
</cfquery>
I can then loop through that query, computing and adding the new info
<cfoutput query="x">
    <!--- compute new values to go into fieldc & fieldd --->
    <cfset x.newFieldC[currentrow] = newvalue>
    <cfset x.newFieldD[currentrow] = newvalue>
</cfoutput>

Rick Root wrote:

>My application loads some data from a query into memory.
>
>Sometimes, I have a need to update this data, and usually what happens 
>is that I update the base tables, then rerun the query.
>
>Unfortunately, it's a lot of data and I'd prefer NOT to re-run the query.
>
>Is there a way to update a query in memory?  I think I tried using an 
>update statement in a query of queries but it didn't work.
>
>Rick
>
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:218533
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to