home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / isquery.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  1017 b   |  38 lines

  1. <!--- Shows an example of IsQuery and IsSimpleValue --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>IsQuery Example</TITLE>
  5. </HEAD>
  6.  
  7. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  8. <BODY  bgcolor="#FFFFD5">
  9. <H3>IsQuery Example</H3>
  10.  
  11. <!--- define a variable called "getEmployees" --->
  12. <CFPARAM name="getEmployees" default="#Now()#">
  13.  
  14. <P>Before the query is run, the value of GetEmployees is
  15. <CFOUTPUT>#getEmployees#</CFOUTPUT>
  16. <CFIF IsSimpleValue(getEmployees)>
  17. <P>getEmployees is currently a simple value
  18. </CFIF>
  19.  
  20. <!--- make a query on the snippets datasource --->
  21. <CFQUERY NAME="getEmployees" DATASOURCE="cfsnippets">
  22. SELECT *
  23. FROM Employees
  24. </CFQUERY> 
  25.  
  26. <P>After the query is run, GetEmployees contains a number of
  27. rows that look like this (display limited to three rows):
  28. <CFOUTPUT QUERY="GetEmployees" MAXROWS="3">
  29. <PRE>#Emp_ID# #Trim(FirstName)# #LastName#</PRE>
  30. </CFOUTPUT>
  31.  
  32. <CFIF IsQuery(getEmployees)>
  33. GetEmployees is no longer a simple value, but the name of a query
  34. </CFIF>
  35.  
  36. </BODY>
  37. </HTML>       
  38.