Lucee Tag Reference

<cfqueryparam>

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.

Body

This tag can't have a body.

Example

<cfqueryparam
	[cfsqltype=string]
	[charset=string]
	[list=boolean]
	[maxlength=number]
	[null=boolean]
	[scale=number]
	[separator=string]
	[sqltype=string]
	[value=any]>
This tag is also supported within cfscript
<cfscript>
	queryparam
		[cfsqltype=string]
		[charset=string]
		[list=boolean]
		[maxlength=number]
		[null=boolean]
		[scale=number]
		[separator=string]
		[sqltype=string]
		[value=any];
</cfscript>

Attributes

The attributes for this tag are fixed. Except for the following attributes no other attributes are allowed.
Name Type Required Description
cfsqltype string No This Attribute is deprecated 
charset string No This attribute is used for 2 things:
- it checks if the given value is compatible with that charset
- to check the binary length of the value (see attribute maxlength). 
list boolean No true, false or not set.
If set to true this indicates that the parameter value of the value attribute is a list of values and is handled as such,
if set to false it is handled as a simple value.
if not set lucee will automatically detect if it is an array or not. 
maxlength number No Maximum length of the parameter. The default value is the length of the string specified in
the value attribute. if the attribute charset is defined, this comparsion will be byte based. 
null boolean No Yes or No. Indicates whether the parameter is passed as a null. If Yes, the tag ignores the
value attribute. The default is No. 
scale number No Number of decimal places of the parameter. The default value is zero. 
separator string No 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. 
sqltype string No The SQL type that the parameter (any type) will be bound to. 
value any No Specifies the actual value that Lucee passes to the right of the comparison operator in a
where clause.