> -----Original Message-----
> From: Matt Stueve [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 16, 2000 9:40 AM
> To: CF-Server
> Subject: RE: question about quotations
>
>
> This message is in MIME format. Since your mail reader does
> not understand
> this format, some or all of this message may not be legible.
>
> ------_=_NextPart_001_01C0378F.B9C0FC40
> Content-Type: text/plain;
> charset="iso-8859-1"
>
> This is a little more database expensive, but it should work:
>
> <cfloop list="#form.phone_number#" index="i" delimiters=",">
> <cfquery name="deletePhone" datasource="#application.dsn#">
> delete phone_detail where phone = '#i#'
> </cfquery>
> </cfloop>
>
> hth,
> Matt
If you're going to take this route, you should store the SQL in a variable
and submit it to the DB in a single batch, and even add transactional code
if you like:
<cfset Variables.SQL="">
<cfloop list="#form.phone_number#" index="i" delimiters=",">
<cfset Variables.SQL=Variables.SQL & "delete phone_detail where
phone = '#i#';">
</cfloop>
<cfquery name="deletePhone" datasource="#application.dsn#">
#PreserveSingleQuotes(Variables.SQL)#
</cfquery>
As a good rule of thumb, never loop over queries, and never put anything
more complex than a simple function call into a CFQuery block.
Cheers,
Christian Gustafson
Senior Software Engineer
Onvia.com
Work. Wisely.
http://www.onvia.com
(p) 206.373.9307
(c) 206.852.6095
------------------------------------------------------------------------------
To unsubscribe, send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body or visit the list page at www.houseoffusion.com