Name

IsQuery

Synopsis

IsQuery(value)

Returns True if the specified value is a valid ColdFusion query or False if it isn’t. Examples:

<CFSET Form.MyFormVar = "This is a form variable">
<CFSET URL.MyURLVar = "This is a URL variable">
<CFSET Grades = ArrayNew(1)>
<CFSET Grades[1] = 95>
<CFSET Grades[2] = 93>
<CFSET Grades[3] = 87>
<CFSET Grades[4] = 100>
<CFSET Grades[5] = 74>

<CFIF IsQuery(Form.MyFormVar)>
  Form.MyFormVar is a query!
<CFELSEIF IsQuery(URL.MyURLVar)>
  URL.MyURLVar is a query!
<CFELSEIF IsQuery(Grades)>
  Grades is a query!
<CFELSE>
  No variables are queries!
</CFIF>

Get Programming ColdFusion now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.