database_to_tcl_list_list

one of the documented procedures in this installation of the ACS
Usage:
database_to_tcl_list_list   db   sql
What it does:
Returns a list of Tcl lists, with each sublist containing the columns returned by the database; if no rows are returned by the database, returns the empty list (empty string in Tcl 7.x and 8.x)
Defined in: /web/philip/packages/acs-core/utilities-procs.tcl

Source code:


    set selection [ns_db select $db $sql]
    set list_to_return [list]
    while {[ns_db getrow $db $selection]} {
	set row_list ""
	set size [ns_set size $selection]
	set i 0
	while {$i<$size} {
	    lappend row_list [ns_set value $selection $i]
	    incr i
	}
	lappend list_to_return $row_list
    }
    return $list_to_return


philg@mit.edu