Child pages
  • QBResult

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Divcache
Div
iddescription
HTML Table
id
classservoy sSummary
Colgroup Tag
Col
width80px
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Summary
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)distinct
styleindexdisplay:none

DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR.

true
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable
idclass

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClient

servoy sSummary12%30%58%height: 30px;3Property SummaryGet/set the distinct flag for the query. Table Row (tr)

Table Cell (td)
QBSelect
Table Cell (td)parent
Table Row (tr)
Table Cell (td)
QBSelect
Table Cell (td)root
Get query builder parent table clause, this may be a query or a join clause.Get query builder parent. HTML Table

Colgroup Tag
Col
width80px
Col
Table Head (thead) Table Row (tr)styleservoy sSummary Table Row (tr)
Table Cell (td)
QBResult
Table Cell (td)add(aggregate)
12%30%58%height: 30px;
Table Head (th)
colspan2
Method Summary
3Methods SummaryAdd an aggregate to the query result. Table Row (tr)
Table Cell (td)
QBResult
Table Cell (td)add(aggregate, alias)
Table Row (tr)
Table Cell (td)
QBResult
Table Cell (td)add(column)
Add an aggregate with alias to the query result.Add a column to the query result. Table Row (tr)
Table Cell (td)
QBResult
Table Cell (td)add(column, alias)
Table Row (tr)
Table Cell (td)
QBResult
Table Cell (td)add(func)
Add a column with alias to the query result.Add a function result to the query result. Table Row (tr)
Table Cell (td)
QBResult
Table Cell (td)add(func, alias)
Add a function with alias result to the query result.Add a case searched expression to the query result.Add a case searched expression with alias to the query result. Table Row (tr)
Table Cell (td)
QBResult
Table Cell (td)addPk()
Table Row (tr)
Table Cell (td)
QBResult
Table Cell (td)addValue(value)
Add the tables' primary pk columns in alphabetical order to the query result.Add a query to the query result.Add a query with alias to the query result.Add a custom subquery to the query result.Add a custom subquery with alias to the query result.Add a value to the query result. Table Row (tr)
Table Cell (td)
QBResult
Table Cell (td)addValue(value, alias)
Table Row (tr)
Table Cell (td)
QBResult
Table Cell (td)clear()
Add a value with an alias to the query result.Clear the columns in the query result. HTML Table
idproperty
classservoy sDetail
Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Details
Table Body (tbody)
iddistinct
Table Row (tr)
idname
Table Cell (td)

distinct

Table Row (tr)
iddes
Table Cell (td) Divclassreturns an array with all the columns that will be in the select of this query.

idpropertyservoy sDetail2100%height:30px2Property Detailsdistinctname

distinct

dessIndent
Get/set the distinct flag for the query.
Table Row (tr)tdret

Returns

divsIndentclients

classid

Supported Clients

sIndent
Boolean Table Row (tr)SmartClient,WebClient,NGClientsam

Table Cell (td)

Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Details
Table Body (tbody)
idadd-QBAggregate
Table Row (tr)
idname
Table Cell (td)

add

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBResult
Span
stylefont-weight: bold;
add
Span
(aggregate)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add an aggregate to the query result.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{QBAggregate} aggregate - the aggregate to add to result
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBResult
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
query.result.add(query.columns.label_text.max)
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idadd-QBAggregate_String
Table Row (tr)
idname
Table Cell (td)

add

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBResult
Span
stylefont-weight: bold;
add
Span
(aggregate, alias)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add an aggregate with alias to the query result.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{QBAggregate} aggregate - the aggregate to add to result
{String} alias - aggregate alias
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBResult
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
query.result.add(query.columns.item_count.max, 'maximum_items')
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idadd-QBColumn
Table Row (tr)
idname
Table Cell (td)

add

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBResult
Span
stylefont-weight: bold;
add
Span
(column)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add a column to the query result.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{QBColumn} column - column to add to result
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBResult
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
query.result.add(query.columns.custname)
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idadd-QBColumn_String
Table Row (tr)
idname
Table Cell (td)

add

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBResult
Span
stylefont-weight: bold;
add
Span
(column, alias)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add a column with alias to the query result.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{QBColumn} column - column to add to result
{String} alias - column alias
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBResult
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
query.result.add(query.columns.custname, 'customer_name')
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idadd-QBFunction
Table Row (tr)
idname
Table Cell (td)

add

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBResult
Span
stylefont-weight: bold;
add
Span
(func)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add a function result to the query result.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{QBFunction} func - the function to add to the result
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBResult
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
query.result.add(query.columns.custname.upper())
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idadd-QBFunction_String
Table Row (tr)
idname
Table Cell (td)

add

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBResult
Span
stylefont-weight: bold;
add
Span
(func, alias)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add a function with alias result to the query result.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{QBFunction} func - the function to add to the result
{String} alias - function alias
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBResult
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
query.result.add(query.columns.custname.upper(), 'customer_name')
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idaddPk
Table Row (tr)
idname
Table Cell (td)

addPk

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBResult
Span
stylefont-weight: bold;
addPk
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add the tables' primary pk columns in alphabetical order to the query result.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBResult
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
query.result.addPk()
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idaddValue-Object
Table Row (tr)
idname
Table Cell (td)

addValue

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBResult
Span
stylefont-weight: bold;
addValue
Span
(value)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add a value to the query result.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} value - value add to result
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBResult
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
query.result.addValue(100)
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idaddValue-Object_String
Table Row (tr)
idname
Table Cell (td)

addValue

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBResult
Span
stylefont-weight: bold;
addValue
Span
(value, alias)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add a value with an alias to the query result.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} value - value add to result
{String} alias - value alias
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBResult
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
query.result.addValue(100, 'myvalue')
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idclear
Table Row (tr)
idname
Table Cell (td)

clear

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBResult
Span
stylefont-weight: bold;
clear
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Clear the columns in the query result.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBResult
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
query.result.clear()
Table Row (tr)
classlastDetailRow
Table Cell (td) 

Sample

Div
classsIndent
Code Block
languagejavascript
query.result.distinct = true
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idparent
Table Row (tr)
idname
Table Cell (td)

parent

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get query builder parent table clause, this may be a query or a join clause.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBSelect
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @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)
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idroot
Table Row (tr)
idname
Table Cell (td)

root

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get query builder parent.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBSelect
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @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)
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
HTML Table
idfunction
classservoy sDetail
sIdentjavascriptlastDetailRowparentname

parent

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

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
rootname

root

dessIndent
Get query builder parent.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow

functionservoy sDetail2100%height:30px2Methods Detailsaddname

add(aggregate)

dessIndent
Add an aggregate to the query result.
prs

Parameters

sIndentaggregatethe aggregate to add to result
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addname

add(aggregate, alias)

dessIndent
Add an aggregate with alias to the query result.
prs

Parameters

sIndentaggregatethe aggregate to add to resultaliasaggregate alias
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addname

add(column)

dessIndent
Add a column to the query result.
prs

Parameters

sIndentcolumncolumn to add to result
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addname

add(column, alias)

dessIndent
Add a column with alias to the query result.
prs

Parameters

sIndentcolumncolumn to add to resultaliascolumn alias
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addname

add(func)

dessIndent
Add a function result to the query result.
prs

Parameters

sIndentfuncthe function to add to the result
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addname

add(func, alias)

dessIndent
Add a function with alias result to the query result.
prs

Parameters

sIndentfuncthe function to add to the resultaliasfunction alias
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addname

add(qcase)

dessIndent
Add a case searched expression to the query result.
prs

Parameters

sIndentqcaseThe searched case expression.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addname

add(qcase, alias)

dessIndent
Add a case searched expression with alias to the query result.
prs

Parameters

sIndentqcaseThe searched case expression.aliasfunction alias
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addPkname

addPk()

dessIndent
Add the tables' primary pk columns in alphabetical order to the query result.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addSubSelectname

addSubSelect(query)

dessIndent
Add a query to the query result.
prs

Parameters

sIndentqueryquery to add to result
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addSubSelectname

addSubSelect(query, alias)

dessIndent
Add a query with alias to the query result.
prs

Parameters

sIndentqueryquery to add to resultaliasresult alias
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addSubSelectname

addSubSelect(customQuery, args)

dessIndent
Add a custom subquery to the query result.
prs

Parameters

sIndentcustomQueryquery to add to resultargsarguments to the query
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addSubSelectname

addSubSelect(customQuery, args, alias)

dessIndent
Add a custom subquery with alias to the query result.
prs

Parameters

sIndentcustomQueryquery to add to resultargsarguments to the queryaliasresult alias
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addValuename

addValue(value)

dessIndent
Add a value to the query result.
prs

Parameters

sIndentvaluevalue add to result
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addValuename

addValue(value, alias)

dessIndent
Add a value with an alias to the query result.
prs

Parameters

sIndentvaluevalue add to resultaliasvalue alias
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
clearname

clear()

dessIndent
Clear the columns in the query result.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getColumnsname

getColumns()

dessIndent
returns an array with all the columns that will be in the select of this query.
can return empty array. Then the system will auto append the pk when this query is used.
ret

Returns

sIndent An array of QBColumn thats in the select of this query.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow