wp_select db sql code { else " " } { elsecode " " }What it does:
Performs a select, setting variables and executing code for each record.Defined in: /web/philip/tcl/wp-defs.tcl
Source code:
uplevel set selection [ns_db select $db $sql] set counter 0 while { [uplevel "ns_db getrow $db " \$selection] } { uplevel set_variables_after_query uplevel $code incr counter } if { $else == "else" } { if { $elsecode == "" } { error "no else code provided" } elseif { $counter == 0 } { uplevel $elsecode } } elseif { $else != "" } { error "invalid syntax (expected else)" }