Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.Opens in a new tab

For information on migrating to InterSystems IRISOpens in a new tab, see Why Migrate to InterSystems IRIS?

実行時のクエリの選択

正しいクエリが動的に選択されるように、TopPicks ページを修正する必要があります。このためには、<csp:query> タグの属性 queryname を変更します。

これまでは、“TopFilms” というリテラル値でクエリ名を指定してきました。

—TopPicks.csp—
TopPicks.csp
<html> <body>
<h2><font color="#0000FF">Today's Top Picks</font></h2>
<table border=0>
<csp:query name=FilmList classname="Cinema.Film" queryname="TopFilms">
<csp:while condition="FilmList.Next()"> ... </csp:while>
</table>
</body> </html>

ここでのクエリ名は、変数 Query の値によって定義されます。また、TopCategory クエリで使用された P1 パラメータは、変数 CatID の値を持つように指定します。

—TopPicks.csp—
TopPicks.csp
<html> <body>
<h2><font color="#0000FF">Today's Top Picks</font></h2>
<table border=0>
<csp:query 
        name=FilmList 
        classname="Cinema.Film" 
        queryname='#(Query)#' 
        P1="#(CatID)#">
<csp:while condition="FilmList.Next()"> ... </csp:while>
</table>
</body> </html>
FeedbackOpens in a new tab