QueryAddRow

Return new query

Method Signature

QueryAddRow(query=[query], rowData=[any])

Arguments

Argument
Type
Required
Description
Default

query

query

true

The query to add the row(s) to.

rowData

any

false

Data to populate the query. Can be a struct (with keys matching column names), an array of structs, or an array of arrays (in same order as columnList)

Examples

Builds a simple query using queryNew and queryAddRow

CF10+ Pass in row data directly to queryAddRow argument.

Run Example

news = queryNew( "id,title", "integer,varchar" );
queryAddRow( news, {
	"id" : 1,
	"title" : "Dewey defeats Truman"
} );
writeDump( news );

Builds a simple query using queryNew and queryAddRow member syntax

CF10+ Pass in row data directly to queryAddRow argument.

Run Example

Builds a simple query using queryNew queryAddRow and querySetCell

Using Script with the queryAddRow querySetCell functions to populate the query.

Run Example

Builds a simple query using queryNew queryAddRow and querySetCell with rows number

The example above could be simplified this way:

Run Example

Builds a simple query using queryNew queryAddRow with multiple rows as an array

CF10+ The example above could be simplified even more this way:

Run Example

Additional Examples

Run Example

Last updated

Was this helpful?