<!--- Create dummy query --->
<cfscript>
        myQuery = queryNew("");
        queryAddColumn(myQuery, "value", listToArray("1,2,3,4,5,6,7,8,9"));
        queryAddColumn(myQuery, "text", listToArray("item 1,item 2,item
3,item 4,item 5,item 6,item 7,item 8,item 9"));
</cfscript>

<cfquery dbtype="query" name="myQuery">
        UPDATE  MyQuery
        SET             value = 'xxx'
</cfquery>

<cfdump var="#myQuery#">


This errors with :-

Query Of Queries syntax error.
Encountered UPDATE. 


So that's a no.

Also I probably wouldn't do it like that anyway.

I would be more inclined to do something like use query of query to query
the first recordset excluding the column your updating and then use
queryAddColumn and pass an array in to add the column back in.  Because
you're using another query you can do something like 

<cfset queryAddColumn(oldquery , "thiscolumn",
listToArray(valueList(sidequery.thisvalue)) />

Which will save you looping over the recordset and populating each row on
its own.


Steve



-----Original Message-----
From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Mike Kear
Sent: Wednesday, 15 August 2007 1:39 PM
To: cfaussie@googlegroups.com
Subject: [cfaussie] Re: Can QofQ do updates?


Thanks Steve,  that was my second choice.

So you are confirming that QofQ doesnt have update?

Cheers
Mike Kear


On 8/15/07, Steve Onnis <[EMAIL PROTECTED]> wrote:
>
>
> <cfset querySetCell(oldquery , "thiscolumn", sidequery.thisvalue,
> sidequery.thisIndex) />
>
> Just do that
>
>
> -----Original Message-----
> From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On 
> Behalf Of Mike Kear
> Sent: Wednesday, 15 August 2007 1:21 PM
> To: cfaussie
> Subject: [cfaussie] Can QofQ do updates?
>
>
> I'm having a problem with a Query of a Query, and it suddenly hit me
> -  maybe QofQ can't actually DO an  update, and that's why I'm getting
> the error!     Can anyone please confirm that it IS indeed a supported
> function in Qof Q??   (we're talking CF7 here)
>
> If not, how would you go about running this code if you can't use 
> query of
> queries:
>
> <cfloop query="sidequery">
> <cfquery name="newquery" dbtype="query"> UPDATE oldquery set 
> thiscolumn = '#sidequery.thisvalue#'
> WHERE index = '#sidequery.thisIndex#'
> </cfquery>
> </cfloop>
>
> (I've already decided that using the original SQLQuery to do all this 
> in one step is too hard for a whole host of reasons)
>
> Cheers
> Mike Kear
> Windsor, NSW, Australia
> Adobe Certified Advanced ColdFusion Developer AFP Webworks 
> http://afpwebworks.com ColdFusion, PHP, ASP, ASP.NET hosting from 
> AUD$15/month
>
>
>
>
> >
>


--
Cheers
Mike Kear
Windsor, NSW, Australia
Adobe Certified Advanced ColdFusion Developer AFP Webworks
http://afpwebworks.com ColdFusion, PHP, ASP, ASP.NET hosting from
AUD$15/month




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to