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

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.

—Query—
<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),
        1:""))#
    #($SELECT(%request.Data("RatingList",1) '= "*":
    " AND Rating = '" _ %request.Data("RatingList",1)_"'",
    1:""))#
    ORDER BY Title
</script>


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