db_list_of_lists

one of the documented procedures in this installation of the ACS
Usage:
db_list_of_lists   sql
What it does:
Returns a list containing lists of the values in each column of each row returned by the SQL query $sql.
Defined in: /web/philip/packages/acs-core/10-database-procs.tcl

Source code:


    # Can't use db_foreach here, since we need to use the ns_set directly.
    db_with_handle db {
	set result [list]
	set selection [ns_db select $db $sql]
	while { [ns_db getrow $db $selection] } {
	    set this_result [list]
	    for { set i 0 } { $i < [ns_set size $selection] } { incr i } {
		lappend this_result [ns_set value $selection $i]
	    }
	    lappend result $this_result
	}
    }
    return $result


philg@mit.edu