db_tree

EveAndersson.com : API Browser : db_tree

db_tree (public)

db_tree sql_name sql [ args... ]
Defined in tcl/ad-trees.tcl

Takes a 'connect by' SQL query and returns the result as a tree.
A tree is either just one element or a list whose first element is the root and whose subsequent elements are the subtrees of the root.

Example (taken from http://photo.net/sql/trees.html)

    
    % db_tree org_chart_get "select slave_id from corporate_slaves
                             start with slave_id = 1
                             connect by prior slave_id = supervisor_id"
    1 2 {3 {4 5}} {6 7 8}
    
This result represents the tree
      1
     /|\ 
    2 3 6
      | |\ 
      4 7 8
      |
      5
    

Parameters:
sql_name
sql
[ show source ]

Show another procedure:

eve@eveandersson.com