[thelist] NYC/DC Tragedy

.jeff jeff at members.evolt.org
Thu Sep 13 13:04:30 CDT 2001


tami,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Tami
>
> This is off-topic, too - but it is very interesting
> - alarming
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

you now owe three tips.  *grin*

one for being off-topic.  another for knowing it's off-topic and posting
anyway without a tip.  and another for posting off-topic stuff that was
posted just yesterday.

everyone, this is *not* the forum for this sort of information.  i
understand your desire to share with others, but please be responsible and
do so only in the appropriate forums.

<tip author=".jeff" type="ColdFusion">

have a bunch of insert queries you need to run at once?  don't open and
close a connection for each one if you don't have to (ie, if your database
server supports the following method).  instead, throw them all into one
query.

so, instead of this:

<cfloop list="#form.registrants#" index="i">
  <cfquery ...>
    INSERT INTO table_name (...)
         VALUES (...)
  </cfquery>
</cfloop>

try this:

<cfif ListLen(form.registrants)>
  <cfquery ...>
    <cfloop list="#form.registrants#" index="i">
      INSERT INTO table_name (...)
           VALUES (...)
    </cfloop>
  </cfquery>
</cfif>

or, even this, if your database supports it:

<cfif ListLen(form.registrants)>
  <cfquery ...>
    INSERT INTO table_name (...)
         VALUES
    <cfloop list="#form.registrants#" index="i">
       <cfif i NEQ ListFirst(form.registrants)>, </cfif>
                (...)
    </cfloop>
  </cfquery>
</cfif>

</tip>

thanks,

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/






More information about the thelist mailing list