<html>
<head>
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>QUERYSETCELL</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
   <div id="Description">
   <table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
      <tr> 
         <td valign="top" class="name">QUERYSETCELL</td>
         <td valign="top" nowrap class="compatibility">&nbsp;</td>
      </tr>
      <tr>
         <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
      </tr>


    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Description</span>
<p>
Sets a cell to a value. If no row number is specified, the cell on the last row is set. 
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Returns</span>
<p>
True, if successful; False, otherwise.
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Category</span>
<p>
Query functions
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Function syntax</span><pre>QuerySetCell(query, column_name, value [, row_number ])
</pre>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">See also</span>
<p>
QueryAddColumn, QueryAddRow, QueryNew; "Creating a record set with a function" in Chapter&#160;22, "Using Query of Queries," in ColdFusion MX Developer's Guide
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Parameters</span>
<p>

</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Example</span><pre>&lt;!--- This example shows the use of QueryAddRow and QuerySetCell ---&gt;

&lt;!--- start by making a query ---&gt;
&lt;cfquery name = &quot;GetCourses&quot; datasource = &quot;cfdocexamples&quot;&gt;
   SELECT Course_ID, Descript 
   FROM Courses
&lt;/cfquery&gt;
&lt;p&gt;The Query &quot;GetCourses&quot; has &lt;cfoutput&gt;#GetCourses.RecordCount#&lt;/cfoutput&gt; 
rows.

&lt;cfset CountVar = 0&gt;
&lt;cfloop CONDITION = &quot;CountVar LT 15&quot;&gt;
   &lt;cfset temp = QueryAddRow(GetCourses)&gt;
   &lt;cfset CountVar = CountVar + 1&gt;
   &lt;cfset Temp = QuerySetCell(GetCourses, &quot;Number&quot;, 100*CountVar)&gt;
   &lt;cfset CountVar = CountVar + 1&gt;
   &lt;cfset Temp = QuerySetCell(GetCourses, &quot;Descript&quot;, 
&quot;Description of variable #Countvar#&quot;)&gt;
&lt;/cfloop&gt;

&lt;P&gt;After the QueryAddRow action, the query has
   &lt;CFOUTPUT&gt;#GetCourses.RecordCount#&lt;/CFOUTPUT&gt; 
   records. 
   &lt;CFOUTPUT query=&quot;GetCourses&quot;&gt; 
   &lt;PRE&gt;#Course_ID# #Course_Number# #Descript#&lt;/pre&gt; &lt;/cfoutput&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="QUERY">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">QUERY</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>


<p>Name of an executed query. </p>

  </td>
  </tr>
  </table>
</div>
<div id="COLUMN_NAME">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">COLUMN_NAME</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>


<p>Name of a column in the query.</p>

  </td>
  </tr>
  </table>
</div>
<div id="VALUE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">VALUE</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>


<p>Value to set in the cell.</p>

  </td>
  </tr>
  </table>
</div>
<div id="ROW_NUMBER">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">ROW_NUMBER</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>


<p>Row number. The default value is last row.</p>

  </td>
  </tr>
  </table>
</div>

  </body>
</html>
