macromedia.coldfusion.cfml_general_discussion
[Top] [All Lists]

Help with code

Subject: Help with code
From: "trojnfn"
Date: Tue, 15 Apr 2008 15:35:44 +0000 UTC
Newsgroups: macromedia.coldfusion.cfml_general_discussion

I got this code from another user, seems to work but has a minor problem.

 It reads a query and produces line items on a form, using #currentrow#. I then 
pass the values to the action page to update, which is below :

 <cfloop from="1" to="#form.record_count#" index="row">

 <cfif isDefined("form.urdn_line_item#row#")>
 <cfparam name="form.urdn_line_item#row#">
 <cfelse>
 <cflocation 
url="close_disposition_urdn_line_items.cfm?urdn_number=#urdn_number#&coming_from
_error=radio_buttons">
 </cfif>

 <cfparam name="form.instructions#row#">
 <cfparam name="form.tracking_number#row#">
 <cfparam name="form.urdn_action#row#">
 <cfparam name="form.urdn_line_item#row#">
 <cfparam name="form.urdn_number#row#">


 <cfset instructions = form["instructions"& row]>
 <cfset tracking_number = form["tracking_number"& row]>
 <cfset urdn_action = form["urdn_action"& row]>
 <cfset urdn_line_item = form["urdn_line_item"& row]>
 <cfset urdn_number = form["urdn_number"& row]>


 <cfquery name="qryUpdate_urdn_line_items" datasource="recDisc">
 update tblUnReceivables_urdn_line_items
     set tracking_number = '#tracking_number#',
     <cfif instructions is "">
        instructions = 'None'
     <cfelse>
     instructions = '#instructions#'
        </cfif>
        where urdn_number = '#urdn_number#'
 and urdn_line_item = '#urdn_line_item#'
 and urdn_action = '#urdn_action#'
 </cfquery>

 </cfloop>

 The problem that I am having is that if a value is 123456 and I try to update 
it with 99999, the value acutally becomes 123456,99999 in the sql table, 
instead of 99999 overriding 123456. 

 How do I correct this ? 

 Thanks


<Prev in Thread] Current Thread [Next in Thread>