DoubleApos (public, deprecated)

 DoubleApos string

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

Deprecated. Invoking this procedure generates a warning.

When the value "O'Malley" is inserted int an SQL database, the single quote can cause troubles in SQL, one has to insert 'O''Malley' instead. Deprecated: in general, one should be using bind variables rather than calling DoubleApos.

Parameters:
string (required)
Returns:
string with single quotes converted to a pair of single quotes
See Also:

Testcases:
No testcase defined.
Source code:
ad_log_deprecated proc DoubleApos
    set result [ns_dbquotevalue $string]
    # remove the leading quote if necessary
    if {[string range $result 0 0] eq '} {
        set result [string range $result 1 end-1]
    }
    return $result
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-tcl/tcl/deprecated-procs.xql

[ hide source ] | [ make this the default ]
Show another procedure: