db_string (public)
db_string [ -dbn dbn ] [ -cache_key cache_key ] \ [ -cache_pool cache_pool ] [ -subst subst ] statement_name sql \ [ -default default ] [ -bind bind ]
Defined in packages/acs-tcl/tcl/01-database-procs.tcl
- 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 (optional, defaults to
"db_cache_pool"
)- Override the default db_cache_pool
- -subst (optional, defaults to
"all"
)- Perform Tcl substitution in xql-files. Possible values: all, none, vars, commands
- -default (optional)
- Return value in case the SQL query returns no value
- -bind (optional)
- bind variables, passed either as an ns_set id, or via bind value list
- Parameters:
- statement_name (required)
- name of the SQL query
- sql (required)
- SQL query to be executed
- Returns:
- the first column of the result of the SQL query sql. If the query doesn't return a row, returns default or raises an error if no default is provided.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- db__caching, db__transaction, db__transaction_bug_3440, nullchar, db__string