• Publicity: Public Only All


Database Query API for the ArsDigita Templating System

29 September 2000
Karl Goldstein <karlg@arsdigita.com>
Stanislav Freidin <sfreidin@arsdigita.com>
CVS Identification:
$Id: query-procs.tcl,v 2021/12/28 16:42:12 antoniop Exp $

Procedures in this file

Detailed information

multirow (public, deprecated)

 multirow [ -ulevel ulevel ] [ -local ] [ -unclobber ] op name \
    [ args... ]
Deprecated. Invoking this procedure generates a warning.

multirow is really template::multirow or possibly template::query::multirow depending on context. the "template::" or "template::query::" may be omitted depending on what the namespace is. .tcl pages are evaluated in the template:: namespace. DEPRECATED: namespace should actually NOT be omitted

-ulevel (defaults to "1") (optional)
-local (boolean) (optional)
-unclobber (boolean) (optional)

See Also:

Partial Call Graph (max 5 caller/called nodes):

No testcase defined.

template::cache (public)

 template::cache command cache_key [ args... ]

Generic Caching


Partial Call Graph (max 5 caller/called nodes):
%3 bug_tracker::bug::cache_flush bug_tracker::bug::cache_flush (public) template::cache template::cache bug_tracker::bug::cache_flush->template::cache forum::flush_templating_cache forum::flush_templating_cache (public) forum::flush_templating_cache->template::cache template::paginator::create template::paginator::create (public) template::paginator::create->template::cache template::paginator::init template::paginator::init (private) template::paginator::init->template::cache template::paginator::reset template::paginator::reset (public) template::paginator::reset->template::cache

No testcase defined.

template::multirow (public)

 template::multirow [ -ulevel ulevel ] [ -local ] [ -unclobber ] \
    command name [ args... ]

Create/Manipulate a multirow datasource (for use with <multiple> tags)

template::multirow create datasourcename column [column ...]
creates a multirow datasource of datasourcename
template::multirow extend datasourcename column [column ...]
extend adds a column to an existing multirow
template::multirow append datasourcename value [value ...]
appends the row to an existing multirow.
template::multirow pop datasourcename
pops a row off an existing multirow, returning a list of the rows keys gand values
template::multirow size datasourcename
returns the rowcount
template::multirow columns datasourcename
returns the columns in the datasource
template::multirow get datasourcename rownum [column]
returns the row of data (or the particular row/column if column is provided)
template::multirow set datasourcename rownum column value
set an element value
template::multirow foreach datasource code
evaluate code block for each row (like db_foreach)
template::multirow upvar datasource [new_name]
upvar the multirow, aliasing to new_name if provided
template::multirow unset datasource
unset multirow
template::multirow sort datasource -lsort-switch col1 col2
Sort the multirow by the column(s) specified. The value sorted by will be the values of the columns specified, separated by the space character. Any switches specified before the columns will be passed directly to the lsort command.
template::multirow exists datasource
Return 1 if the multirow datasource exists, 0 if it doesn't.

-ulevel (defaults to "1") (optional)
Used in conjunction with the "local" parameter to specify how many levels up the multirow variable resides.
-local (boolean) (optional)
If set, the multirow will be looked for in the scope the number of levels up given by ulevel (normally the caller's scope), instead of the [template::adp_level] scope, which is the default.
-unclobber (boolean) (optional)
This only applies to the 'foreach' command. If set, will cause the proc to not overwrite local variables. Actually, what happens is that the local variables will be overwritten, so you can access them within the code block. However, if you specify -unclobber, we will revert them to their original state after execution of this proc.
command - Multirow datasource operation: create, extend, append, pop, size, get, set, foreach, upvar
name - Name of the multirow datasource

See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 test_db__transaction_bug_3440 db__transaction_bug_3440 (test acs-tcl) template::multirow template::multirow test_db__transaction_bug_3440->template::multirow template::adp_level template::adp_level (public) template::multirow->template::adp_level template::util::is_nil template::util::is_nil (public) template::multirow->template::util::is_nil acs_user::demote_user acs_user::demote_user (public) acs_user::demote_user->template::multirow ad_context_bar_multirow ad_context_bar_multirow (public) ad_context_bar_multirow->template::multirow ad_dimensional ad_dimensional (public) ad_dimensional->template::multirow ad_page_contract ad_page_contract (public) ad_page_contract->template::multirow apm_build_repository apm_build_repository (private) apm_build_repository->template::multirow


template::query (public)

 template::query statement_name result_name type sql [ args... ]

Public interface to template query api. This routine parses the arguments and dispatches to the query command specified by the type argument.

statement_name - Standard db_api query name
result_name - Tcl variable name when doing an uplevel to set the returned result
type - The query type
sql - The sql to be used for the query
Limits the query results of a multirow query to a fixed number of rows.
Cache the query results keyed on an identifier that is unique for both the query and the bind variables used in the query. The cached result reflects any initial specification of maxrows and startrows.
Force a query to be performed even if it is cached, and refresh the cache.

Only applicable if the cache option is specified as well. Does not affect a previously specified timeout period.

The maximum period of time for which the cached results are valid in seconds. Only applicable for persistently cached results.
Cache the query results persistently, so that all subsequent requests use the results.
1 if query was a success, 0 if it failed

Partial Call Graph (max 5 caller/called nodes):
%3 packages/bookmarks/www/bookmark-edit.tcl packages/bookmarks/ www/bookmark-edit.tcl template::query template::query packages/bookmarks/www/bookmark-edit.tcl->template::query packages/bookmarks/www/bookmark-view.tcl packages/bookmarks/ www/bookmark-view.tcl packages/bookmarks/www/bookmark-view.tcl->template::query db_qd_get_fullname db_qd_get_fullname (public) template::query->db_qd_get_fullname db_with_handle db_with_handle (public) template::query->db_with_handle template::get_cached_result template::get_cached_result (private) template::query->template::get_cached_result template::set_cached_result template::set_cached_result (private) template::query->template::set_cached_result template::util::get_opts template::util::get_opts (public) template::query->template::util::get_opts

No testcase defined.

template::url (public)

 template::url command [ args... ]

Partial Call Graph (max 5 caller/called nodes):
%3 template::filter template::filter (public) template::url template::url template::filter->template::url

No testcase defined.
[ show source ]