Sets the cell in a specified column to a specified value. If no row number is specified, the cell on the last row will be set. Returns TRUE.
See also QueryAddColumn and QueryAddRow.
QuerySetCell(query, column_name, value [, row_number ])
Name of the query already executed.
Name of the column in the query.
Value to set in the specified cell.
Number of the row. Defaults to last row.
<!--- This example shows the use of QueryAddRow and QuerySetCell ---> <HTML> <HEAD> <TITLE> QuerySetCell Example </TITLE> </HEAD> <BODY> <H3>QuerySetCell Example</H3> <!--- start by making a query ---> <CFQUERY NAME="GetEmp" DATASOURCE="HRApp"> SELECT * FROM Departments </CFQUERY> <P>The Query "GetEmp" has <CFOUTPUT>#GetEmp.RecordCount# </CFOUTPUT> rows.<BR> <CFSET CountRecs=#GetEmp.RecordCount# +1> <CFSET Temp=QueryAddRow(GetEmp)> <CFSET Temp=QuerySetCell(GetEmp, "Department_ID", CountRecs)> <CFSET Temp=QuerySetCell(GetEmp, "Department_Name", "Engineering")> <CFSET Temp=QuerySetCell(GetEmp, "Location", "Cambridge")> <CFOUTPUT QUERY="GetEmp"> #Department_ID#. #Department_Name#, #Location#<BR> </CFOUTPUT> </BODY> </HTML>