The proc.setCellValue() function
Use the setCellValue()
function to edit
a particular cell value in the current copy of the result set. The
new edited result set can be used in SAVE
or EXPORT
command.
Syntax
setCellValue(row, column, value);
Parameter | Description |
---|---|
row | It specifies the row of the cell, the value of which you want to get. |
column | It specifies the column of the cell, the value of which you want to get. |
Example
/*JavaScript*/
proc.exec('DISPLAY Q.INTERVIEW');
var currentTime = new Date();
currentTime = currentTime.getHours() + ':' + currentTime.getMinutes()
+ ':' + currentTime.getSeconds();
var numRows = proc.getNumRows();
for (var i = 1; i <= numRows; i++)
{
proc.setCellValue(i, 4, currentTime);
}
proc.exec('EXPORT DATA TO D:\\qinterview_updated.txt')
The
example procedure displays the Q.INTERVIEW
query,
gets the number of rows in the query result set, replaces time data
in the fourth column with the current time, and exports the updated
copy of the query results to the specified file: D:\qinterview_updated.txt
.