Checks the data type of a query parameter.

The cfqueryparam tag is nested within a <cfquery> tag. It is embedded within the query SQL statement. If you specify its optional parameters, cfqueryparam also performs data validation.

It's use is essential for performance and security

This tag cannot have a body.

This tag is also supported within <cfscript>

Attribute Description
number, optional

Maximum length of the parameter. The default value is the length of the string specified in the value attribute.

boolean, optional

Yes or No. Indicates that the parameter value of the value attribute is a list of values, separated by a separator character. The default is No

number, optional

Number of decimal places of the parameter. The default value is zero.

string, optional

Specifies the character that separates values in the list of parameter values in the value attribute. The default is a comma. If you specify a list of values for the value attribute, you must also specify the list attribute.

boolean, optional

Yes or No. Indicates whether the parameter is passed as a null. If Yes, the tag ignores the value attribute. The default is No.

string, optional

This attribute has been deprecated, use instead the attribute "sqltype" that has exact the same functionality.

any, optional

Specifies the actual value that Lucee passes to the right of the comparison operator in a where clause.

string, optional

The SQL type that the parameter (any type) will be bound to.



lucee+trycf <cfscript> _test = queryNew("_id,_need,_forWorld","integer,varchar,varchar", [[01,'plant', 'agri'],[02, 'save','water']]); </cfscript> <cfquery name="qTest" dbtype="query"> select * from _test where _id = <cfqueryparam cfsqltype="cf_sql_integer" value="2" /> </cfquery> <cfdump var="#qtest#" />

See also