User Guide
170 CFML Language Reference
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/No"
>
AND/OR ...additional criteria of the WHERE clause...
</CFQUERY>
VALUE
Required. Specifies the actual value that ColdFusion passes to the right of the
comparison operator in a where clause. See Usage section for details.
CFSQLTYPE
Optional. This is the SQL type that the parameter (any type) will be bound to. The
default value is CF_SQL_CHAR. The CFSQLTypes are as follows:
CF_SQL_BIGINT CF_SQL_IDSTAMP CF_SQL_REFCURSOR
CF_SQL_BIT CF_SQL_INTEGER CF_SQL_SMALLINT
CF_SQL_CHAR CF_SQL_LONGVARCHAR CF_SQL_TIME
CF_SQL_DATE CF_SQL_MONEY CF_SQL_TIMESTAMP
CF_SQL_DECIMAL CF_SQL_MONEY4 CF_SQL_TINYINT
CF_SQL_DOUBLE CF_SQL_NUMERIC CF_SQL_VARCHAR
CF_SQL_FLOAT CF_SQL_REAL