Chapter 1: ColdFusion Tags
171
MAXLENGTH
Optional. Maximum length of the parameter. The default value is the length of the
string specified in the VALUE attribute.
SCALE
Optional. Number of decimal places of the parameter. The default value is zero.
Applicable for CF_SQL_NUMERIC and CF_SQL_DECIMAL.
NULL
Optional. Specify Yes or No. Indicates whether the parameter is passed as a NULL.
If you specify Yes, the tag ignores the VALUE attribute. The default value is No.
Usage
The CFQUERYPARAM is designed to do the following things:
•
Allows the use of SQL bind parameters.
•
Allows long text fields to be updated from an SQL statement.
•
Improves performance.
The ColdFusion ODBC, DB2, Informix, Oracle 7 and Oracle 8 drivers support SQL bind
parameters. However, at present, the ColdFusion Sybase 11 driver and Sybase native
driver do not support SQL bind parameters.
If a database does not support bind parameters, ColdFusion still performs validation
and substitutes the validated parameter value back into the string. If validation fails,
an error message is returned. The validation rules follow:
•
For types CF_SQL_SMALLINT, CF_SQL_INTEGER, CF_SQL_REAL,
CF_SQL_FLOAT, CF_SQL_DOUBLE, CF_SQL_TINYINT, CF_SQL_MONEY,
CF_SQL_MONEY4, CF_SQL_DECIMAL, CF_SQL_NUMERIC, and
CF_SQL_BIGINT, data values can be converted to a numeric value.
•
For types CF_SQL_DATE, CF_SQL_TIME and CF_SQL_TIMESTAMP, data values
can be converted to a date supported by the target data source.
•
For all other types, if the MAXLENGTH attribute is used, data value cannot
exceed the maximum length specified.
The SQL syntax generated by the ColdFusion server is dependent on the target
database.
For an ODBC, DB2, or Informix data source, the generated syntax of the SQL statement
is as follows:
SELECT *
FROM courses
WHERE col1=?
For an Oracle 7 or Oracle 8 data source, the syntax of the SQL statement is as follows:
SELECT *
FROM courses
WHERE col1=:1
Summary of Contents for COLDFUSION 4.5-CFML LANGUAGE
Page 1: ...Allaire Corporation CFML Language Reference ColdFusion 4 5...
Page 207: ...Chapter 1 ColdFusion Tags 183 CFCATCH CFTRY BODY HTML...
Page 224: ...200 CFMLLanguageReference CFOUTPUT P Text within CFOUTPUT is always shown CFOUTPUT BODY HTML...
Page 336: ...312 CFMLLanguageReference CFIF BODY HTML...
Page 404: ...380 CFMLLanguageReference DE It is morning CFOUTPUT P BODY HTML...
Page 413: ...Chapter 2 ColdFusion Functions 389 Customer BalanceDue BR CFOUTPUT CFIF BODY HTML...
Page 483: ...Chapter 2 ColdFusion Functions 459 CFOUTPUT CFLOOP BODY HTML...
Page 584: ...560 CFMLLanguageReference...
Page 594: ...570 CFMLLanguageReference...