Checking Query Parameters With Cfqueryparam - MACROMEDIA COLDFUSION 5-DEVELOPING Develop Manual

Table of Contents

Advertisement

94
Code
Salary:
<input type="text"
<cfif isdefined("Form.StartDate")>
</cfif>

Checking query parameters with cfqueryparam

You can use the
validate the value of the SQL query parameter against a SQL data type such as REAL,
TIME, or DATE. The
The
decimal places.
Note
The
performance, maintenance, and security of data queries by improving server-side
caching for Oracle databases, supporting updating of long text fields from a SQL
statement, and preventing a malicious user from attaching multiple SQL statements
to a SQL statement substitution variable. For more information on
and its use, see the CFML Reference.
The
the database system and Web server software that you are using:
name="Salary"
size="10"
maxlength="10"><br>
<cfoutput>
Start Date is:
#DateFormat(Form.StartDate)#<br>
Salary is:
#DollarFormat(Form.Salary)#
</cfoutput>
cfqueryparam
cfqueryparam
If the value does not match the data type, the tag returns an error message.
If the value matches the data type and the database driver supports data bind
parameters, the tag generates a SQL BIND PARAMETER statement to bind the
parameter.
If the database driver does not support bind parameters, the tag just uses the
parameter value in the query string.
tag can also validate parameter value length and its number of
cfqueryparam
tag allows you to specify SQL parameters in queries. It improves
cfqueryparam
tag can have any of several additional advantages, depending on
cfqueryparam
Some Web servers have security issues in which SQL appended to URL strings
can evade system security.
Some database management systems, including some Oracle releases, limit the
size of query text fields to 4K bytes. By using
this limitation.
Using
cfqueryparam
Description
Create a text box called Salary in which
users can enter their salary. Make it
exactly ten characters wide.
Output the values of the StartDate and
Salary form fields only if they are
defined. They are not defined until you
submit the form, so they do not appear
on the initial form. Use the
function to display the start date in the
default date format. Use the
DollarFormat
salary with a dollar sign and commas.
tag to validate SQL query parameters. This tag can
tag validates the data as follows:
cfqueryparam
can speed database processing by using bind parameters.
Chapter 6 Making Variables Dynamic
function to display the
can help prevent this problem.
you can overcome
cfqueryparam
DateFormat
cfqueryparam

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 5

Table of Contents