db_qd_replace_sql (public)
db_qd_replace_sql [ -ulevel ulevel ] [ -subst subst ] statement_name \ sql
Defined in packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tcl
- Switches:
- -ulevel (optional)
- -subst (optional, defaults to
"all"
)- Parameters:
- statement_name (required)
- sql (required)
- Returns:
- sql for statement_name (defaulting to sql if not found)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- db__db_foreach, db_bind_var_substitution, db__transaction, db__transaction_bug_3440
Source code: set fullquery [db_qd_fetch $statement_name] if {$fullquery ne ""} { set sql [db_fullquery_get_querytext $fullquery] if {[info exists ulevel]} { if {$subst ne "none"} { if {$subst eq "all"} { set flags -nobackslashes } elseif {$subst eq "vars"} { set flags "-nobackslashes -nocommands" } elseif {$subst eq "commands"} { set flags "-nobackslashes -novars" } else { ns_log warning "invalid value passed to '-subst': $subst. possible: all, none, vars, commands" set flags -nobackslashes } set sql [uplevel $ulevel [list subst {*}$flags $sql]] } } } else { #db_qd_log Debug "NO FULLQUERY FOR $statement_name --> using default SQL" if { $sql eq "" } { # The default SQL is empty, that implies a bug somewhere in the code. error "No fullquery for $statement_name and default SQL empty - query for statement missing" } } return $sqlXQL Not present: Generic, PostgreSQL, Oracle