Queries
CSP supports several different ways to query Caché:
Query Type | CSP Tag and Attributes | Description |
---|---|---|
Class Query |
<csp:query>
|
Executes a class query defined in a Caché class. Returns a %ResultSetOpens in a new tab object. Use <csp:while> to iterate through the result set. |
Dynamic SQL |
<script>
|
Executes the query in-line in the CSP code. Returns a %ResultSetOpens in a new tab object. Use <csp:while> to iterate through the result set. |
Query Type | CSP Tag and Attributes | Description |
---|---|---|
Embedded SQL |
<script>
|
Supports both cursor and non-cursor based. For non-cursor based, only the language attribute is supported. For cursor-based, use <csp:while> to iterate through the result set. The <csp:while> tag supports the cursor and into attributes. The value should be the same as that in the <script> tag. The value of into is the list of variables containing the query results. |
For an example of using a <csp:query> tag to execute a Class Query, see the CSP Tags: <csp:query> section of Part I of this tutorial.
To learn more about using SQL with CSP, read the discusion of “SQL” in the Tag-Based Development with CSP section of Using Caché Server Pages.
To learn more about Embedded SQL in Caché, read Embedded SQL in Using Caché SQL. To learn more about Dynamic SQL in Caché read Dynamic SQL in Using Caché SQL.