You have to wrap it in cfoutput or it'll try to put that text into the
dbase.

'<cfoutput>#evaluate("FORM.PhoneID" & 1)#</cfoutput>'

_____________________________
steve oliver
senior internet developer
atnet solutions, inc.
http://www.atnetsolutions.com


-----Original Message-----
From: Paul Ihrig [mailto:[EMAIL PROTECTED]] 
Sent: Monday, March 11, 2002 1:11 PM
To: CF-Talk
Subject: RE: Update multiple rows


thanks Steve
but that gives me this error:
i may just do all updates separately.
not sure

ODBC Error Code = 22005 (Error in assignment)


[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting
the
varchar value 'evaluate("FORM.PhoneID" & 1)' to a column of data type
int.


-paul



-----Original Message-----
From: Steve Oliver [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 11, 2002 12:23 PM
To: CF-Talk
Subject: RE: Update multiple rows


Whoops, should be

SET PhoneNumb='evaluate("FORM.PhoneNumb" & #Emp#)'
WHERE tblPhone.EmpResID = '#FORM.EMPLOYEE_ID#'
AND tblPhone.PhoneID = 'evaluate("FORM.PhoneID" & #Emp#)'

_____________________________
steve oliver
senior internet developer
atnet solutions, inc.
http://www.atnetsolutions.com


-----Original Message-----
From: Steve Oliver [mailto:[EMAIL PROTECTED]] 
Sent: Monday, March 11, 2002 12:17 PM
To: CF-Talk
Subject: RE: Update multiple rows


You could user currentrow like so.

<input type="hidden" name="records" value="#set_Emp.recordcount#">
<cfloop query="set_Emp">
<INPUT TYPE="text" NAME="PhoneNumb#currentrow#"
VALUE="#Trim(PhoneNumb)#" SIZE="14"
MAXLENGTH="14" class='input'>
<input type='hidden' name='PhoneID#currentrow#' value='#Trim(PhoneID)#'>
<br>
</cfloop>

Then in the action page, do something like this.

<cfquery name="UpdatePhone" datasource="RPH" dbtype="ODBC">
<cfloop from="1" to="#FORM.records#" index="Emp">
UPDATE tblPhone
SET PhoneNumb='evaluate(#FORM.PhoneNumb# & #Emp#)'
WHERE tblPhone.EmpResID = '#FORM.EMPLOYEE_ID#'
AND tblPhone.PhoneID = 'evaluate(#FORM.PhoneID# & #Emp#)'
</cfloop>
</cfquery>


_____________________________
steve oliver
senior internet developer
atnet solutions, inc.
http://www.atnetsolutions.com


-----Original Message-----
From: Paul Ihrig [mailto:[EMAIL PROTECTED]] 
Sent: Monday, March 11, 2002 12:07 PM
To: CF-Talk
Subject: Update multiple rows


ok i am trying to update multiple rows based on a form element that
loops
over a query
can this be done? my action in the UPDATE is not working right.
using sql 7.

i could just do one at a time easy enough.
but would like to do them together.

<!--- Form Page --->

<cfloop query="set_Emp">
<INPUT TYPE="text" NAME="PhoneNumb" VALUE="#Trim(PhoneNumb)#" SIZE="14"
MAXLENGTH="14" class='input'>
<input type='hidden' name='PhoneID' value='#Trim(PhoneID)#'>
<br>
</cfloop>


<!--- Action Page --->

<cfquery name="UpdatePhone" datasource="RPH" dbtype="ODBC">
UPDATE tblPhone
SET PhoneNumb='#FORM.PhoneNumb#'
WHERE tblPhone.EmpResID = '#FORM.EMPLOYEE_ID#'
AND tblPhone.PhoneID = '#FORM.PhoneID#'</cfquery>

Thank You
-paul




______________________________________________________________________
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/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to