<cfquery >
<cfloop index="index" list="#mylist#>
insert into my_table
(id, itemName)
values
(#ID#, '#index#' )
</cfloop>
</cfquery>
J
..
..
-----Original Message-----
From: Thanh Nguyen [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 04, 2002 8:20 PM
To: CF-Talk
Subject: Insert a list into a table - help!!!
I have a list with at least 3 items. And I want to insert it into
table.
right now, I'm looping through the list to insert them into db, but
this is
like writing multiple cfquery's. and what happens if my list has 20
items.
<cfloop index="index" list="#mylist#>
<cfquery >
insert into my_table
(id, itemName)
values
(#ID#, '#index#' )
</cfquery>
</cfloop>
Is there a better way to do this?
______________________________________________________________________
Dedicated Windows 2000 Server
PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
Instant Activation � $99/Month � Free Setup
http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists