August 2003
Intermediate to advanced
1140 pages
68h 45m
English
QuerySetCell
QuerySetCell(query, columnname, value [, row])Sets the cell in columnname to
value for the specified
query. An optional
row number may be set, specifying the row
for the cell to be set in. If no row
number is specified, the cell in the last row of the query is set.
QuerySetCell( ) returns true
upon successful completion. Here’s an example that
adds data to an empty query:
<cfset Products = QueryNew("ProductName, Color, Price, Qty")>
<cfset NewRows = QueryAddRow(Products, 3)>
<cfset QuerySetCell(Products, "ProductName", "Widget", 1)>
<cfset QuerySetCell(Products, "Color", "Silver", 1)>
<cfset QuerySetCell(Products, "Price", "19.99", 1)>
<cfset QuerySetCell(Products, "Qty", "46", 1)>
<cfset QuerySetCell(Products, "ProductName", "Thingy", 2)>
<cfset QuerySetCell(Products, "Color", "Red", 2)>
<cfset QuerySetCell(Products, "Price", "34.99", 2)>
<cfset QuerySetCell(Products, "Qty", "12", 2)>
<cfset QuerySetCell(Products, "ProductName", "Sprocket", 3)>
<cfset QuerySetCell(Products, "Color", "Blue", 3)>
<cfset QuerySetCell(Products, "Price", "1.50", 3)>
<cfset QuerySetCell(Products, "Qty", "460", 3)>
<cfdump var="#Products#">