query

This type represents a representation of a database query result set.

It provides language specific methods to access columnar data, both as value lists and within iterative loops

Query Methods

addColumn(columnName=[string], datatype=[any], array=[array])

Adds a column to a query and populates its rows with the contents of a one-dimensional array.

Arguments:

addRow(rowData=[any])

Return new query

Arguments:

append(query2=[query])

This function clears the query

Arguments:

clear()

This function clears the query

columnArray()

This function returns the column array of a query.

columnCount()

This function returns the number of columns in a query

columnData(columnName=[string])

Returns the data in a query column.

Arguments:

columnExists(column=[string])

This function returns true if the column exists in the query

Arguments:

currentRow()

Returns the current row number

deleteColumn(column=[string])

Deletes a column within a query object.

Arguments:

deleteRow(row=[integer])

This function deletes a row from the query

Arguments:

each(callback=[function], parallel=[boolean], maxThreads=[integer])

Iterates over query rows and passes each row per iteration to a callback function

Arguments:

every(closure=[function], parallel=[boolean], maxThreads=[integer])

Executes a callback/closure against every row in a query and returns true if the callback/closure returned true for every row.

Arguments:

filter(callback=[function], parallel=[boolean], maxThreads=[integer])

Filters query rows specified in filter criteria

Arguments:

getCell(column_name=[string], row_number=[integer])

This function maps the query to a new query.

Arguments:

getResult()

Returns the metadata of a query.

keyExists(key=[string])

This function returns true if the key exists in the query

Arguments:

map(callback=[function], parallel=[boolean], maxThreads=[integer])

This function maps the query to a new query.

Arguments:

prepend(query2=[query])

Adds a query to the beginning of another query

Arguments:

recordCount()

This function returns the number of records in a query

reduce(callback=[function], initialValue=[any])

This function reduces the query to a single value.

Arguments:

rowData(rowNumber=[integer])

Returns the cells of a query row as a structure

Arguments:

setCell(column=[string], value=[any], row=[integer])

Sets a cell to a value.

Arguments:

setRow(rowNumber=[integer], rowData=[any])

Adds or updates a row in a query based on the provided row data and position.

Arguments:

slice(offset=[integer], length=[integer])

Returns a subset of rows from an existing query

Arguments:

some(callback=[function], parallel=[boolean], maxThreads=[integer], initialValue=[any])

This function calls a given closure/function with every element in a given query and returns true, if one of the closure calls returns true

Arguments:

sort(sortFunc=[function])

Sorts array elements.

Arguments:

toImmutable()

Convert an array, struct or query to its immutable counterpart.

toJSON(queryFormat=[string], useSecureJSONPrefix=[boolean], useCustomSerializer=[boolean])

Converts a BoxLang variable into a JSON (JavaScript Object Notation) string.

Arguments:

toMutable()

Convert an array, struct or query to its mutable counterpart.

Examples

Last updated

Logo

Copyright & Register Trademark by Ortus Solutions, Corp & Ortus Software, LLC