ad_dimensional_sql (public)
ad_dimensional_sql option_list [ what ] [ joiner ] [ options_set ]
Defined in packages/acs-templating/tcl/dimensional-procs.tcl
Given what clause we are asking for and the joiner this returns the sql fragment
- Parameters:
- option_list (required)
- the structure with the option data provided
- what (optional, defaults to
"where"
)- look for such keys in the option_list
- joiner (optional, defaults to
"and"
)- join string for combining multiple clauses
- options_set (optional)
- ns_set for reading variables
- Returns:
- SQL clause
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- ad_dimensional
Source code: set out {} if {$option_list eq ""} { return } if {$options_set eq ""} { 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 { $options_set ne ""} { set option_val [ns_set get $options_set $option_key] } #otherwise get from default if { $option_val eq "" } { set option_val [lindex $option 2] } foreach option_value [lindex $option 3] { set thisoption [lindex $option_value 0] if {$option_val eq $thisoption } { set code [lindex $option_value 2] if {$code ne ""} { if {[lindex $code 0] eq $what } { append out " $joiner [uplevel [list subst [lindex $code 1]]]" } } } } } return $outXQL Not present: Generic, PostgreSQL, Oracle