Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
sviolet #1
Problem updating unique mutiple records
What I need to do:
Create an output form where users can update/delete a particular entry in my
database.
For example:
Entry 1
TBL_GEOREF_ID: 834
Values: xx
***Update Button 1***
Entry 2
TBL_GEOREF_ID: 835
Values: xxx
***Update Button 2***
I don't want to have a form where both entries are updated. I want the user to
be able to update just entry 2, or just entry 1.
I am not sure how to do this:
At the moment
My code:
output form:
<CFQUERY NAME="EditQueryInstreamWork" DATASOURCE="Instreamworks">
select *
FROM TBL_GEOREF, TBL_INSTREAM_WORK
WHERE TBL_INSTREAM_WORK.TBL_PROJECT_INFO_ID=#TBL_PROJECT _INFO_ID#
AND TBL_INSTREAM_WORK.TBL_GEOREF_ID=TBL_GEOREF.TBL_GEO REF_ID
</CFQUERY>
<cfloop query="EditQueryInstreamWork">
<tr><td><font color="000080" size="3" face="Verdana">Reason for
Work:</font></TD><td><font color="000080" size="3" face="Verdana">
<INPUT NAME="REASON" SIZE="65" STYLE="COLOR:cc0000;"
value="#EditQueryInstreamWork.WORK_REASON#"></font></td></tr>
<INPUT TYPE="submit" STYLE="FONT-WEIGHT: bold; width: 150px; height: 25px;
COLOR:
333366 ; FONT-FAMILY: Verdana" value="Save Changes"
onClick="parent.location='InStreamUpdate2.cfm?TBL_ GEOREF_ID=#EditQueryInstreamWo
rk.TBL_GEOREF_ID#'">
</CFOUTPUT>
</cfloop>
My update page:
<CFQUERY DATASOURCE="InstreamWorks" NAME="InsertInstreamWork1">
UPDATE TBL_INSTREAM_WORK
SET WORK_REASON='#Form.REASON#',
WHERE TBL_GEOREF_ID=#FORM.TBL_GEOREF_ID#
</CFQUERY>
I get the following error message on the update page:
Syntax error (comma) in query expression 'TBL_GEOREF_ID=834,835'.
Thanks for your help
sviolet Guest
-
Problem inserting/updating records
Hi I'm having trouble trying to insert/update the records in SQL Server. I have created a form based on two tables and created a select... -
Updating Multi records
Is there any way to update muliple records in one database table in one go? -
One Form, Mutiple Inserts, Multiple Records
I am attempting to create a form which allows multiple record inserts. This will be used to add classes by participant to a training database. The... -
Updating Multiple Records
I have a table in a database that contains all my photos. The fields are like Name, SRC, GalleryName, DateAdded, SpecialStyle. The only one you may... -
Unique Records in asp
Hi, How can I count only unique records in a recordset? (sql server 7.0). When I do a select query for an asp page, I may have more than 1... -
BSterner #2
Re: Problem updating unique mutiple records
As the error indicates, you have a comma in your update query that's causing
the syntax error.
<CFQUERY DATASOURCE="InstreamWorks" NAME="InsertInstreamWork1">
UPDATE TBL_INSTREAM_WORK
SET WORK_REASON='#Form.REASON#',
WHERE TBL_GEOREF_ID=#FORM.TBL_GEOREF_ID#
</CFQUERY>
get rid of the comma after: WORK_REASON='#Form.REASON#'
BSterner Guest



Reply With Quote

