Thanks for the replies.

Yes, I was just tring not to do a possible 1k db calls.
Just tring to cut down on the network traffic.
I will do a few test runs and see if there is enough of a performance
improvement to not do the loop.

Thanks
Rodney  

-----Original Message-----
From: Brad Wood [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 17, 2007 4:38 PM
To: CF-Talk
Subject: RE: QofQ insert

I do not believe what you are looking for is possible.

Depending on your DBMS you have a couple different options.

Instead of creating a query object, perhaps you could re-factor your code to
insert into a table variable in a cfquery tag and then to the insert from
there.

Another solution would be to serialize the query object into XML, and pass
it into a proc or SQL statement where the XML could be parsed on the SQL
server into a result set and do your insert from their.  That would be
pretty dependant on SQL Server 2000, or 2005 though.

Why are you opposed to looping over the result set?  If you are trying to
avoid a performance problem, the methods above wouldn't be much better since
they all involve looping at some level.  You could at least try to
minimalize locks open on the table by doing the insert all at once as
opposed to one at a time.

You could move the cfloop inside the cfquery and produce sql like such:

Insert into table (col1, col2)
(select 'foo1', 'bar1' 
Union all select 'foo2', 'bar2' 
Union all select 'foo3', 'bar3' 
Union all select 'foo'4, 'bar4')

~Brad

-----Original Message-----



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:294991
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to