CFQUERYPARAM

CFQUERYPARAM checks the data type of a query parameter. The CFQUERYPARAM tag is nested within a CFQUERY tag. More specifically, it is embedded within the query SQL statement. If you specify its optional parameters, CFQUERYPARAM also performs data validation.

Note

For data, you must specify the MAXLENGTH attribute in order to ensure that maximum length validation is enforced.

See the Usage section for details.

Syntax

 <CFQUERY NAME="query_name" DATASOURCE="ds_name" …other attributes… > SELECT STATEMENT WHERE column_name= <CFQUERYPARAM VALUE="parameter value" CFSQLType="parameter type" MAXLENGTH="maximum parameter length" SCALE="number of decimal places" DBNAME="database name" NULL="Yes" or "No" LIST="Yes" or "No" SEPARATOR="separator ...

Get Sams Teach Yourself ColdFusion® in 21 Days 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.