home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 139 / dpcs0999.iso / Web / CFserver / data1.cab / Documentation / snippets / valuelist.cfm < prev    next >
Encoding:
Text File  |  1999-04-12  |  706 b   |  30 lines

  1. <!--- This example shows the use of ValueList --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>ValueList Example</TITLE>
  5. </HEAD>
  6.  
  7. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  8. <BODY  bgcolor="#FFFFD5">
  9. <H3>ValueList Example</H3>
  10.  
  11. <!--- use the contents of one query to create another
  12. dynamically --->
  13. <CFQUERY NAME="GetDepartments" DATASOURCE="cfsnippets">
  14. SELECT Dept_ID FROM Departments
  15. WHERE Dept_ID IN ('BIOL')
  16. </CFQUERY>
  17.  
  18. <CFQUERY NAME="GetCourseList" DATASOURCE="cfsnippets">
  19. SELECT     *
  20. FROM     CourseList
  21. WHERE     Dept_ID IN ('#ValueList(GetDepartments.Dept_ID)#')
  22. </CFQUERY>
  23.  
  24. <CFOUTPUT QUERY="GetCourseList" >
  25. <PRE>#Course_ID#    #Dept_ID#    #CorNumber#    #CorName#</PRE>
  26. </CFOUTPUT>
  27.  
  28. </BODY>
  29. </HTML>       
  30.