> I am tiring to update multiple records with different values.
> I am getting the following error
>
> Error Executing Database Query.
>
> Syntax error (missing operator) in query expression
> 'fld_item_ID = 'evaluate(1235,1237,1236,1236 & 1)' update
> tbl_865_orders_items set fld_qty_shipped =
> 'evaluate(500,50,100,100 & 2)' where fld_item_ID =
> 'evaluate(1235,1237,1236,1236 & 2)' update
> tbl_865_orders_items set fld_qty_shipped'.
It seems as if you are trying to update multiple records with different
quantities and different id's. You would be best to update them one at
a time using cfquery, something like the method I've shown below.
HTH
<!--- FORM
------------------------------------------ --->
<cfquery name="RequestItemsDetail" datasource="print_shop">
SELECT
tbl_masterlist.fld_desc
, tbl_865_orders_items.fld_qty_ordered
, tbl_865_orders_items.fld_prod_code
, tbl_865_orders_items.fld_item_ID
, tbl_865_orders_items.fld_qty_shipped
FROM
tbl_masterlist
, tbl_865_orders_items
WHERE
tbl_865_orders_items.fld_wo_num = <cfqueryparam
value="#fld_wo_num#" cfsqltype="cf_sql_integer"/>
and tbl_masterlist.fld_prod_code =
tbl_865_orders_items.fld_prod_code
</cfquery>
<form name="whatever" action="whereever" method="post">
<!--- Loop round all your products and output a quantity field
and hidden id element in order --->
<cfoutput query="RequestItemsDetail">
<cfinput type="hidden"
name="fld_item_ID_#RequestItemsDetail.currentrow#" value="#fld_item_ID#"
/>
<cfinput type="text"
name="fld_qty_shipped_#RequestItemsDetail.currentrow#"
value="#(fld_qty_ordered-fld_qty_shipped)#" />
<br/>
</cfoutput>
<!--- Output no of records so that know how many to loop over in
action page --->
<input type="hidden" name="records"
value="#RequestItemsDetail.recordcount#"/>
<input type="submit" name="submit" value="Update"/>
</form>
<!--- UPDATE
------------------------------------------ --->
<!--- Loop over the number of records that were on the previous form
--->
<cfloop from="1" to="#form.records#" index="ii">
<!--- Get the ID of the product and the quanitity from the order
form --->
<cfset variables.thisId = form["fld_item_ID_"&ii]/>
<cfset variables.thisQuantity = form["fld_qty_shipped_"&ii]/>
<!--- Update this product with the new id --->
<cfquery name="setQtystatus" datasource="print_shop">
update
tbl_865_orders_items
set
fld_qty_shipped = <cfqueryparam
value="#variables.thisQuantity#" cfsqltype="cf_sql_varchar"/>
where
fld_item_ID = <cfqueryparam
value="#variables.thisId#" cfsqltype="cf_sql_integer"/>
</cfquery>
</cfloop>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:252340
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4