home *** CD-ROM | disk | FTP | other *** search
- <!--- This example shows the use of QuotedValueList --->
-
- <HTML>
-
- <HEAD>
- <TITLE>
- QuotedValueList Example
- </TITLE>
- </HEAD>
-
- <BASEFONT FACE="Arial, Helvetica" SIZE=2>
- <BODY bgcolor="#FFFFD5">
-
- <H3>QuotedValueList Example</H3>
-
- <!--- use the contents of one query to create another
- dynamically --->
- <CFSET List = "'BIOL', 'CHEM'">
-
- <!--- first, get the department ids in our list --->
- <CFQUERY NAME="GetDepartments" DATASOURCE="cfsnippets">
- SELECT Dept_ID FROM Departments
- WHERE Dept_ID IN (#PreserveSingleQuotes(List)#)
- </CFQUERY>
-
- <!--- now, select the courses for that department based
- on the quotedValueList produced from our previous query --->
- <CFQUERY NAME="GetCourseList" DATASOURCE="cfsnippets">
- SELECT *
- FROM CourseList
- WHERE Dept_ID IN (#QuotedValueList(GetDepartments.Dept_ID)#)
-
- </CFQUERY>
-
- <!--- now, output the results --->
- <CFOUTPUT QUERY="GetCourseList" >
- <PRE>#Course_ID# #Dept_ID# #CorNumber# #CorName#</PRE>
- </CFOUTPUT>
-
-
- </BODY>
-
- </HTML>
-