since your table column names are the same as the form field names you would
be much better off using CFUPDATE

<CFUPDATE DATASOURCE="ds_name"
    DBTYPE="type"
    DBSERVER="dbms"
    DBNAME="database name"
    TABLENAME="table_name"
    TABLEOWNER="name"
    TABLEQUALIFIER="qualifier"
    USERNAME="username"
    PASSWORD="password"
    PROVIDER="COMProvider" 
    PROVIDERDSN="datasource" 
    FORMFIELDS="field_names">

                                                    
Bryan Love ACP
Internet Application Developer
[EMAIL PROTECTED]
                                                    


-----Original Message-----
From: Tristram Charnley [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 17, 2001 9:20 AM
To: CF-Talk
Subject: CFLoop inside an update query


Hi,
Im building a dynamic update query by looping
over the form structure within the query- but how can I
build the loop so that the comma is left off after the last
iteration of the loop? I've tried nesting loops to no
avail. Any quick pointers appreciated.

Here is the query so far:

<CFQUERY DATASOURCE="#application.DS#">
UPDATE          DBGENERE
SET       
<cfloop collection="#form#" item="Value">
<cfoutput>

        #Value#='#Form[Value]#',

</cfoutput>
</cfloop>

WHERE etc etc
        
</CFQUERY>

Thanks

Tristram Charnley
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to