home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 1999 April / APC443.iso / features / grpware / coldfus / coldfusi.exe / data1.cab / Documentation / snippets / valuelist.cfm < prev    next >
Encoding:
Text File  |  1998-10-08  |  644 b   |  29 lines

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