Forum OpenACS Development: Re: General Comment editing issue Solved, and the true source is in core.

Jim

This code block

foreach value [list a b c] {
#do something
}

the varaible "value" is still set after the foreach code block. db_foreach and db_multirow behave exactly the same way.

So for a Tcl programmer it is expected behavior. The only thing you need to remember is that the variables matching the columns in the query are created within the loop so they can overwrite variables in the caller since that is the level the code block runs at, and they exist in the caller's level after the code block completes.