Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRISOpens in a new window, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions pageOpens in a new window (login required).

Previous sectionNext section


Define and execute a predefined class query




General Attributes

Attribute Description Value
CLASSNAME Name of the class containing the query. A valid class name (including package name).
MODE Runtime mode of the query. “LOGICAL”, “ODBC”, “DISPLAY”, or “SYSTEM”.
NAME Name of local variable used to refer to the %ResultSetOpens in a new window object created for this query. A valid variable name.
P1 Value of the first query parameter. A string.
P2 Value of the second query parameter. A string.
P3 Value of the third query parameter. A string.
P4 Value of the fourth query parameter. A string.
QUERYNAME Name of the class query. A valid query name.


The CSP:QUERY tag creates a %ResultSetOpens in a new window object based on a query defined within a Caché class. This tag defines a server-side variable, whose name is specified by the tag's name attribute, that refers to a %ResultSetOpens in a new window object. The %ResultSetOpens in a new window object is automatically executed (by calling its Execute method using the parameter values given by the various Pn attributes of the tag) and is ready for use within the page. The %ResultSetOpens in a new window object is automatically closed at the end of the generated OnPage method.

For example, the following opens a %ResultSetOpens in a new window object (named query) based on the ByName query within the Sample.Person class and then displays the results of the query in an HTML unordered list (<UL>):

<CSP:QUERY NAME="query" CLASSNAME="Sample.Person" QUERYNAME="ByName">
<CSP:WHILE CONDITION="query.Next()">
Copy code to clipboard
FeedbackOpens in a new window