Forum OpenACS Q&A: Re: How to retrieve data using quries written in Xql with TCL and ADP


Queries in xql files which are bound to tcl/adp templating pairs are not named with any "namespaces". Their scope is only the corresponding tcl file, so you just name them like this:
<fullquery name="user_name_select">

and then include the name in any db_* procedure (see, e.g.
db_0or1row user_name_select {}

However, if the queries are used in package procs (in tcl subdir of a package), they should be named with their full namespace, e.g.
<fullquery name="logger::package::variables_multirow.select_variables">

They work with only name="proc_name.query_name" but the use of namespaces is AFAIK highly recommended. As Robert said before, you can find a lot of examples from the existing packages.

Just remember, that the xql files are parsed upon server startup, so you *have* to restart the server if you change them.