> > > Also, if you're using a database engine that allows TSQL, > then put > > > the loop inside the CFQUERY and put a ; at the end of each INSERT > > > > This looks like a good tip, can this be done with other Databases as > > well? i.e. Oracle? Have always coded the loop outside the cfquery > > tag, anybody got any performance info on this? > > AFAIK, any of the "big" SQL engines, SQL Server, Oracle and > such all deal with multiple requests in one query, this saves > traffic to the database server... >
Why have I not thought of that before... it seems so obvious now :-) Will be putting it to the test later on this afternoon! You got any performance info on that? > > > > <cfloop list="#form.Accomidations#" index="x"> > > > > <cfquery datasource="blah" > name="insertAccomidation"> > > > > insert into tblAccomidations (personKey, > > > > accomitationId) values(pid,x) > > > > </cfquery> > > > > </cfloop> > > > > > > Not forgetting to put #'s around your variables; > > > > > > insert into tblAccomidations (personKey, accomitationId) > > > values(#pid#,#x#) > > > > Jeez, where have all the cfqueryparam's gone.... Sorry Philip, being a bit pedantic :-) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. http://www.cfhosting.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4