The easiest way would be to loop over the initial query and either make each
DB insert a new inline query, or you can make a <cffunction> that does the
insert and call the method from the loop.
eg
<cffunction name="insertIntoTable">
  <cfargument name="value1" />
  <cfargument name="value2" /
    <cfquery datasource="#getDsn()#">
     INSERT INTO .....VALUES ( "#arguments.value1#", "#arguments.value1#")
    </cfquery>
</cffunction>


<cfloop query="myQuery">
  <cfset insertIntoTable(myQuery.myValue1, myQuery.myValue2) />
</cfloop>

AD HOK CODE!!

On Tue, Jul 21, 2009 at 8:21 PM, KNOTT, Brian <[email protected]>wrote:

>  Guys having a slow brain day.
>
> I have a query that I have created from code using the QueryNew command.
>
> I now want to insert this into a database, something like
>
> <cfquery name="data" datasource="SQLServer">
> INSERT INTO databaseTable
> SELECT Title, title as Modelname, ModelPath, ModelEmailString,
> CubePublishPath, PPESPublishPath, ModelUserSecurity,
> ModelBuildExtraCommandsPre, ModelBuildExtraCommandsPost, BuildLevel,
> BusinessName, Duration, Keywords, NotifyStatus, MajorGrouping,
> MinorGrouping, ModelLabel, Frequency, Status, PrimaryMDC, ItemType, Path
> FROM queryInMomory
> </cfquery>
>
> Thanks
>
> *Brian Knott*
> Software Engineer (COGNOS Developer) | MIS Front End | Banking & Life MIS
> *ext* 31221* ph* 07 3333 1221
>
>
>
>  *  ________________________________  *
> This e-mail is sent by Suncorp-Metway Limited ABN 66 010 831 722 or one of
> its related entities "Suncorp".
> Suncorp may be contacted at Level 18, 36 Wickham Terrace, Brisbane or on 13
> 11 55 or at suncorp.com.au.
> The content of this e-mail is the view of the sender or stated author and
> does not necessarily reflect the view of Suncorp. The content, including
> attachments, is a confidential communication between Suncorp and the
> intended recipient. If you are not the intended recipient, any use,
> interference with, disclosure or copying of this e-mail, including
> attachments, is unauthorised and expressly prohibited. If you have received
> this e-mail in error please contact the sender immediately and delete the
> e-mail and any attachments from your system.
> If this e-mail constitutes a commercial message of a type that you no
> longer wish to receive please reply to this e-mail by typing Unsubscribe in
> the subject line.
>
> >
>


-- 
-- if you've written a homegrown[*CFML] controller layer that rivals the
sophistication and ease of use of the three major players (MG/MII/FB) - then
share it or shut up. You code in a silo - that's great. Just stay in there
and don't try to tell everyone how good it smells.
--Dave Ross

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to [email protected]
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