database_to_tcl_tree db sqlWhat it does:
takes a 'connect by' SQL query and returns the result as a treeDefined in: /web/philip/tcl/ad-trees.tcl
Source code:
# Augment the SQL query by selecting the level. regsub select $sql "select level," sql # query the database set list [database_to_tcl_list_list $db $sql] # Construct a tree from the result. # Afterwards, eliminate the level attribute in the tree. tree_map tail [tree_make $list head]