Hi I am having trouble running a query in an SFC step.
[code]# reset index
chart.index = 1
query for routine where the remainder of chart.index divided by priorty is equal to 0
query = "SELECT path, priority FROM routine WHERE ?%priority = 0"
params = chart.index
chart.routine_dataset = system.db.runPrepQuery(query,[params])
not sure if this is necessary
data = chart.routine_dataset
set the number of rows of the dataset to determine the number of times to loop through it
chart.routine_dataset_length = data.rowCount
[/code]
The next step this is what I am doing to write to the tag paths stored in the dataset.
[code] row = chart.routine_dataset_index # determine row based on routine dataset index
col = "path" # we want the column named Path
chart.routine_path = chart.routine_dataset.getValueAt(row,col) #get the tag path based on row and column
system.tag.write(chart.routine_path,1) # write the demand poll bit to true
[/code]
followed by
chart.routine_dataset_index = chart.routine_dataset_index + 1