Skip to Main Content
Programming ColdFusion MX, 2nd Edition
book

Programming ColdFusion MX, 2nd Edition

by Rob Brooks-Bilson
August 2003
Intermediate to advanced content levelIntermediate to advanced
1140 pages
68h 45m
English
O'Reilly Media, Inc.
Content preview from Programming ColdFusion MX, 2nd Edition

Name

QuerySetCell

Synopsis

                  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#">
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming ColdFusion

Programming ColdFusion

Rob Brooks-Bilson

Publisher Resources

ISBN: 0596003803Supplemental ContentErrata Page