Skip to end of metadata
Go to start of metadata



Property Summary
Boolean distinct
Get/set the distinct flag for the query.
QBSelect parent
Get query builder parent table clause, this may be a query or a join clause.
QBSelect root
Get query builder parent.



Method Summary
QBResult add(aggregate)
Add an aggregate to the query result.
QBResult add(aggregate, alias)
Add an aggregate with alias to the query result.
QBResult add(column)
Add a column to the query result.
QBResult add(column, alias)
Add a column with alias to the query result.
QBResult add(func)
Add a function result to the query result.
QBResult add(func, alias)
Add a function with alias result to the query result.
QBResult addPk()
Add the tables' primary pk columns in alphabetical order to the query result.
QBResult addValue(value)
Add a value to the query result.
QBResult addValue(value, alias)
Add a value with an alias to the query result.
QBResult clear()
Clear the columns in the query result.



Property Details

distinct

Get/set the distinct flag for the query.

Returns

Sample

query.result.distinct = true
 

parent

Get query builder parent table clause, this may be a query or a join clause.

Returns

Sample

/** @type {QBSelect<db:/example_data/person>} */
	var query = databaseManager.createSelect('db:/example_data/person')
	query.where.add(query.joins.person_to_parent.joins.person_to_parent.columns.name.eq('john'))
	foundset.loadRecords(query)
 

root

Get query builder parent.

Returns

Sample

/** @type {QBSelect<db:/example_data/order_details>} */
	var subquery = databaseManager.createSelect('db:/example_data/order_details')

 /** @type {QBSelect<db:/example_data/orders>} */
	var query = databaseManager.createSelect('db:/example_data/orders')
	query.where.add(query
		.or
			.add(query.columns.order_id.not.isin([1, 2, 3]))

			.add(query.exists(
					subquery.where.add(subquery.columns.orderid.eq(query.columns.order_id)).root
			))
		)

	foundset.loadRecords(query)
 



Method Details

add

QBResult add (aggregate)
Add an aggregate to the query result.

Parameters

{QBAggregate} aggregate - the aggregate to add to result

Returns

Sample

query.result.add(query.columns.label_text.max)
 

add

QBResult add (aggregate, alias)
Add an aggregate with alias to the query result.

Parameters

{QBAggregate} aggregate - the aggregate to add to result
{String} alias - aggregate alias

Returns

Sample

query.result.add(query.columns.item_count.max, 'maximum_items')
 

add

QBResult add (column)
Add a column to the query result.

Parameters

{QBColumn} column - column to add to result

Returns

Sample

query.result.add(query.columns.custname)
 

add

QBResult add (column, alias)
Add a column with alias to the query result.

Parameters

{QBColumn} column - column to add to result
{String} alias - column alias

Returns

Sample

query.result.add(query.columns.custname, 'customer_name')
 

add

QBResult add (func)
Add a function result to the query result.

Parameters

{QBFunction} func - the function to add to the result

Returns

Sample

query.result.add(query.columns.custname.upper())
 

add

QBResult add (func, alias)
Add a function with alias result to the query result.

Parameters

{QBFunction} func - the function to add to the result
{String} alias - function alias

Returns

Sample

query.result.add(query.columns.custname.upper(), 'customer_name')
 

addPk

QBResult addPk ()
Add the tables' primary pk columns in alphabetical order to the query result.

Returns

Sample

query.result.addPk()
 

addValue

QBResult addValue (value)
Add a value to the query result.

Parameters

{Object} value - value add to result

Returns

Sample

query.result.addValue(100)
 

addValue

QBResult addValue (value, alias)
Add a value with an alias to the query result.

Parameters

{Object} value - value add to result
{String} alias - value alias

Returns

Sample

query.result.addValue(100, 'myvalue')
 

clear

QBResult clear ()
Clear the columns in the query result.

Returns

Sample

query.result.clear()
 



  • No labels