I hope you're cfparam'ing those queries ! :)

For multiple inserts, I've used a format like so:

<cfquery>
INSERT INTO tableA
(name1,name2)
select 'jack','jill'
union all
select 'bill','brad'
</cfquery>

> -----Original Message-----
> From: Will Tomlinson [mailto:[EMAIL PROTECTED]
> Sent: Thursday, January 13, 2005 9:32 PM
> To: CF-Talk
> Subject: Multiple INSERTS- one cfquery?
> 
> On my clothing database, I have a situation where I have to delete from
> one FK table, then the PK table. I do it in one cfquery like so:
> 
>  <cfquery datasource="#DSN#">
>   DELETE FROM dbo.tblavailablecolors WHERE prodID='#URL.ID#';
>   DELETE FROM dbo.tblproducts WHERE prodID='#URL.ID#'
>   </cfquery>
> 
> I started thinking about my product insertion scenario. It runs though 4
> inserts with multiple cfquerys on one page. Why couldn't I place all of
> them into one cfquery? Wouldn't it execute faster? Or is this a tacky way
> to do things?
> 
> Thanks,
> Will
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190386
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