This email is to be read subject to the disclaimer below.
Marika,
The correct code is:
<cfquery name="InsertCoord" datasource="Hum" dbtype="ODBC">
UPDATE Humtest
SET Coordinator = <cfqueryparam value="#form.coordinator#" cfsqltype
="cf_sql_varchar">
WHERE ID IN (<cfqueryparam value="#ValueList(Tasks.ID)#" cfsqltype
="cf_sql_integer" list="yes">)
</cfquery>
My bad :-)
Viktor Radnai
Web Developer, National E-Commerce, Ernst & Young
Direct: +61 2 9248 4361
Marika Auret
<[EMAIL PROTECTED] To: "CFAussie Mailing List" <[EMAIL
PROTECTED]>
u> cc:
Sent by: Subject: [cfaussie] Re:
Updating Multiple Rows simoultaneously -
[EMAIL PROTECTED] Help!
mon.com.au
26/03/2003 06:34 PM
Please respond to "CFAussie
Mailing List"
Hi Viktor
Thanks so much for that. It is a much better method than what I was
proposing! I am getting a 'Syntax error in UPDATE statement' error when I
run the code but should be able to work that one out.
Thanks again for your help.
Cheers
Marika
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, 26 March 2003 11:43 AM
To: CFAussie Mailing List
Subject: [cfaussie] Re: Updating Multiple Rows simoultaneously - Help!
This email is to be read subject to the disclaimer below.
Hi Marika,
Is this what you're looking for? (warning: it's untested so there might be
some typos)
<cfquery name="Tasks" datasource="Hum" dbtype="ODBC">
SELECT ID, Coordinator
FROM Humtest
</cfquery>
<cfquery name="InsertCoord" datasource="Hum" dbtype="ODBC"> UPDATE Humtest
SET Coordinator WHERE ID IN (<cfqueryparam value="#ValueList(Tasks.ID)#"
cfsqltype ="cf_sql_integer" list="yes">) </cfquery>
Cheers,
Vik
---------------------
Viktor Radnai
Web Developer, National E-Commerce, Ernst & Young
Direct: +61 2 9248 4361
Marika Auret
<[EMAIL PROTECTED] To: "CFAussie
Mailing List" <[EMAIL PROTECTED]>
u> cc:
Sent by: Subject:
[cfaussie] Updating Multiple Rows simoultaneously - Help!
[EMAIL PROTECTED]
mon.com.au
26/03/2003 02:36 PM
Please respond to "CFAussie
Mailing List"
Hi Everyone
Hoping someone can help me with this one - what is the best format for
updating several rows in a database simoultaneously with values put into a
web form?
I have a web form setup that lists the records of a database with one of
the
fields (a text field) being updateable. I want to be able to add content to
the text field for each record and then to update it in the database in one
hit.
I have tried using a cfloop but it doesn't update the correct record/s. I
am
using Access. Here is a sample of the code for the form action page:
<cfquery name="Tasks" datasource="Hum" dbtype="ODBC">
SELECT ID, Coordinator
FROM Humtest
</cfquery>
<cfloop query="Tasks">
<cfquery name="InsertCoord" datasource="Hum" dbtype="ODBC"> INSERT INTO
Humtest (Coordinator) VALUES ('#Form.Coordinator#') </cfquery> </cfloop>
I have tried putting in a WHERE statement but can't make it work, and I am
not even sure that the above code is the best format to use. I have a
hidden
form field to capture the ID (the primary key) info on the form itself.
There is probably a very easy solution for this - but it has been one of
those days already!
Thanks a million, in advance, for any advice
Cheers
Marika
---
You are currently subscribed to cfaussie as:
[EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/
--------------------
NOTICE - This communication contains information which is confidential and
the copyright of Ernst & Young or a third party.
If you are not the intended recipient of this communication please delete
and destroy all copies and telephone Ernst & Young on 1800 655 717
immediately. If you are the intended recipient of this communication you
should not copy, disclose or distribute this communication without the
authority of Ernst & Young.
Any views expressed in this Communication are those of the individual
sender, except where the sender specifically states them to be the views of
Ernst & Young.
Except as required at law, Ernst & Young does not represent, warrant and/or
guarantee that the integrity of this communication has been maintained nor
that the communication is free of errors, virus, interception or
interference.
Liability limited by the Accountants Scheme, approved under the
Professional
Standards Act 1994 (NSW)
--------------------
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/
---
You are currently subscribed to cfaussie as:
[EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/
--------------------
NOTICE - This communication contains information which is confidential and
the copyright of Ernst & Young or a third party.
If you are not the intended recipient of this communication please delete
and destroy all copies and telephone Ernst & Young on 1800 655 717
immediately. If you are the intended recipient of this communication you
should not copy, disclose or distribute this communication without the
authority of Ernst & Young.
Any views expressed in this Communication are those of the individual
sender, except where the sender specifically states them to be the views of
Ernst & Young.
Except as required at law, Ernst & Young does not represent, warrant and/or
guarantee that the integrity of this communication has been maintained nor
that the communication is free of errors, virus, interception or
interference.
Liability limited by the Accountants Scheme, approved under the
Professional Standards Act 1994 (NSW)
--------------------
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/