Forum OpenACS Development: using results from db_multirow

Request notifications

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 &#34;x < $core_units:rowcount&#34;
    set data &#34;$data  -> $core_units:uos_code&#34;
    set x [expr $x + 1]
set data &#34;$data end; }&#34;

however I seem to get an error saying :

can&#39;t read &#34;core_units&#34;: no such variable
    while executing
&#34;while &#34;x < $core_units:rowcount&#34;

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; }"