Home
The Toolkit for Online Communities
17466 Community Members, 3 members online, 2267 visitors today
Log In Register
OpenACS Home : Forums : OpenACS Development : using results from db_multirow

Forum OpenACS Development: using results from db_multirow

Icon of envelope Request notifications

Collapse
Posted by Matthew Taylor on
I want to be able to iterate through the results of db_multirow:

db_multirow core_units core_units_sql { }

I want to put all the values from "core_units" into a string that will look like this "start -> unit1 -> unit2 ->... -> unitn -> end;" I tried the following code:

set data "digraph elec { start"
while "x < $core_units:rowcount"
{
    set data "$data  -> $core_units:uos_code"
    set x [expr $x + 1]
}
set data "$data end; }"

however I seem to get an error saying :

can't read "core_units": no such variable
    while executing
"while "x < $core_units:rowcount"

Collapse
Posted by Claudio Pasolini on
set data "digraph elec { start"
db_multirow core_units core_units_sql { } {
append data " -> $uos_code"
}
set data "$data end; }"