Caché Web Applications Tutorial
Adding Selection Criteria 2
[Home] [Back] [Next]
InterSystems: The power behind what matters   

We can do the same thing for the rating drop-down list. Insert the following query into the indicated place in SearchResults.csp and our Search Results page is complete.

<script language="sql" name=FilmList>
    SELECT ID, Description, Length, Rating, Title, Category->CategoryName
    FROM Cinema.Film
    WHERE PlayingNow = 1
        #($SELECT(%request.Data("CategoryList",1) '= "*":
        " AND Category = " _ %request.Data("CategoryList",1),
    #($SELECT(%request.Data("RatingList",1) '= "*":
    " AND Rating = '" _ %request.Data("RatingList",1)_"'",
    ORDER BY Title

Send us comments on this page
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA