Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 700

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Flex and AIR Integration in ColdFusion
About CF.query function syntax
You can write the
CF.query
named argument style is more readable, but it requires more code. Although the positional argument style supports a
subset of
arguments, it allows a more compact coding style that is more appropriate for simple expressions
CF.query
of the
function.
CF.query
Using CF.query named argument syntax
The
function accepts the following named arguments:
CF.query
// CF.query named argument syntax
CF.query
({
datasource:"data source name",
sql:"SQL stmts",
username:"username",
password:"password",
maxrows:number,
timeout:milliseconds
})
Note: The named argument style requires curly brackets {} to surround the function arguments.
Using CF.query positional argument syntax
Positional arguments support a subset of
is the syntax for the positional argument style:
// CF.query positional argument syntax
CF.query(datasource, sql);
CF.query(datasource, sql, maxrows);
CF.query(datasource, sql, username, password);
CF.query(datasource, sql, username, password, maxrows);
Note: When using positional arguments, do not use curly braces {}.
About the CF.query record set
The
function returns a RecordSet object, which is an instance of the RecordSet class of objects. The
CF.query
RecordSet class provides a wide range of functions for handling record set data.
You use methods in the RecordSet ActionScript class in your client-side ActionScript to change data returned in the
record set.
CF.query
Currently, the following methods are available in the RecordSet class:
Method
addItem
addItemAt
addView
filter
getColumnNames
getItemAt
getItemID
ActionScript function using either named arguments or positional arguments. The
arguments, and you can create more efficient code. The following
CF.query
Description
Appends a record to the end of the specified RecordSet
Inserts a record at the specified index
Requests notification of changes in a RecordSet object's state
Creates a RecordSet object that contains selected records from the original RecordSet object
Returns the names of all the columns of the RecordSet
Retrieves a record from a RecordSet object
Gets the unique ID corresponding to a record
Last updated 1/20/2012
695

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents