ad_dimensional_sql

one of the documented procedures in this installation of the ACS
Usage:
ad_dimensional_sql   option_list   { what "where" }   { joiner "and" }   { options_set "" }
What it does:
see ad_dimensional for the format of option_list

Given what clause we are asking for and the joiner this returns the sql fragment

Defined in: /web/philip/packages/acs-core/table-display-procs.tcl

Source code:


    set out {}

    if {[empty_string_p $option_list]} {
        return
    }

    if {[empty_string_p $options_set]} {
        set options_set [ns_getform]
    }

    foreach option $option_list { 
        # find out what the current option value is.
        # check if a default is set otherwise the first value is used
        set option_key [lindex $option 0]
        set option_val {}
        # get the option from the form
        if { ! [empty_string_p $options_set]} {
            set option_val [ns_set get $options_set $option_key]
        }
        #otherwise get from default
        if { [empty_string_p $option_val] } {
            set option_val [lindex $option 2]
        }
        
        foreach option_value [lindex $option 3] { 
            set thisoption [lindex $option_value 0]
            if {[string compare $option_val $thisoption] == 0} {
                set code [lindex $option_value 2]
                if {![empty_string_p $code]} {
                    if {[string compare [lindex $code 0] $what] == 0} {
                        append out " $joiner [uplevel [list subst [lindex $code 1]]]"
                    }
                }
            }
        }
    }

    return $out


philg@mit.edu