template::query::onerow (private)

 template::query::onerow statement_name db result_name sql

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

Process a onerow query. Use a single array to store the results.

Parameters:
statement_name - Standard db_api statement name used to hook into query dispatcher
db - Database handle
result_name - Tcl variable name to use when setting the result
sql - Query to use when processing this command

Partial Call Graph (max 5 caller/called nodes):
%3 db_exec db_exec (public) template::query::onerow template::query::onerow template::query::onerow->db_exec

Testcases:
No testcase defined.
Source code:

    upvar opts opts

    set row [db_exec 0or1row $db $statement_name $sql 3]

    if { $row ne "" } {

        # Set the results in the calling frame.
        upvar $opts(uplevel) $result_name result

        array set result [ns_set array $row]

        if { [info exists opts(cache)] } {
            set opts(result) [array get result]
        }
        return 1
    } else {
        return 0
    }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: