template::util::tcl_to_sql_list (public, deprecated)

 template::util::tcl_to_sql_list lst

Defined in packages/acs-templating/tcl/deprecated-procs.tcl

Deprecated. Invoking this procedure generates a warning.

Convert a Tcl list to a SQL list, for use with the "in" statement. Uses double single quotes to escape single quotes in values. DEPRECATED: NaviServer now provides a native API ns_dbquotelist for this; a tcl-implemented fallback for older NaviServer versions exists in current OpenACS code.

Parameters:
lst (required)
See Also:

Testcases:
No testcase defined.
Source code:
ad_log_deprecated proc template::util::tcl_to_sql_list

    if { [llength $lst] > 0 } {
        # replace single quotes by two single quotes
        regsub -all -- ' "$lst" '' lst2
        set sql "'"
        append sql [join $lst2 "', '"]
        append sql "'"
        return $sql
    } else {
        return ""
    }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: