ad_sql_get (public, deprecated)

 ad_sql_get sqlarrayname

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

Deprecated. Invoking this procedure generates a warning.

Parameters:
sqlarrayname (required)
array reference
Returns:
a SQL statement constructed from the pieces provided via ad_sql_append This is unused and untested code.
See Also:

Testcases:
No testcase defined.
Source code:
ad_log_deprecated proc ad_sql_get
    upvar $sqlarrayname sql

    if { ![info exists sql(select)] } {
        error "SQL statement doesn't have any SELECT clause"
    }
    if { ![info exists sql(from)] } {
        error "SQL statement doesn't have any FROM clause"
    }

    set sql_string "select [join $sql(select) ""]\nfrom [join $sql(from) ""]\n"

    if { [info exists sql(where)] && [llength $sql(where)] > 0 } {
        append sql_string "where [join $sql(where) "\nand "]\n"
    }

    if { [info exists sql(groupby)] && [llength $sql(groupby)] > 0 } {
        append sql_string "group by [join $sql(groupby) ""]\n"
    }

    if { [info exists sql(orderby)] && [llength $sql(orderby)] > 0 } {
        append sql_string "order by [join $sql(orderby) ""]\n"
    }

    return $sql_string
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-tcl/tcl/deprecated-procs.xql

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