db_0or1row (public)
db_0or1row [ -dbn dbn ] [ -cache_key cache_key ] \ [ -cache_pool cache_pool ] [ -subst subst ] statement_name sql \ [ -bind bind ] [ -column_array column_array ] \ [ -column_set column_set ]
Defined in packages/acs-tcl/tcl/01-database-procs.tcl
Performs the SQL query sql. If a row is returned, sets variables to column values (or a set or array populated if -column_array or column_set is specified) and returns 1. If no rows are returned, returns 0.
- Switches:
- -dbn
(optional)- The database name to use. If empty_string, uses the default database.
- -cache_key
(optional)- Cache the result using given value as the key. Default is to not cache.
- -cache_pool
(defaults to"db_cache_pool"
) (optional)- Override the default db_cache_pool
- -subst
(defaults to"all"
) (optional)- Perform Tcl substitution in xql-files. Possible values: all, none, vars, commands
- -bind
(optional)- bind variables, passed either as an ns_set id, or via bind value list
- -column_array
(optional)- array to be populated with values
- -column_set
(optional)- ns_set to be populated with values
- Parameters:
- statement_name
sql
- Returns:
- 1 if variables are set, 0 if no rows are returned. If more than one row is returned, throws an error.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- db__caching, db__0or1row, db__1row