Child pages
  • QBResult

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
{div:style=}
Wiki Markup
Div
styledisplay: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.

\\ \\ Enter additional information related to this



Enter additional information related to this 'class'

inside

the

\

{div}

macro

with

'id=description'

{div} {div:id=description}{div}\\ {table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Property Summary{th}{tr}{tbody}{tr}{td}[Boolean]{td}{td}[#distinct] Get/set the distinct flag for the query.{td}{tr}{tbody}{tbody}{tr}{td}[QBSelect]{td}{td}[#parent] Get query builder parent table clause, this may be a query or a join clause.{td}{tr}{tbody}{tbody}{tr}{td}[QBSelect]{td}{td}[#root] Get query builder parent.{td}{tr}{tbody}{table}\\ {table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[QBResult]{td}{td}[#add]\(aggregate) Add an aggregate to the query result.{td}{tr}{tbody}{tbody}{tr}{td}[QBResult]{td}{td}[#add]\(aggregate, alias) Add an aggregate with alias to the query result.{td}{tr}{tbody}{tbody}{tr}{td}[QBResult]{td}{td}[#add]\(column) Add a column to the query result.{td}{tr}{tbody}{tbody}{tr}{td}[QBResult]{td}{td}[#add]\(column, alias) Add a column with alias to the query result.{td}{tr}{tbody}{tbody}{tr}{td}[QBResult]{td}{td}[#add]\(func) Add a function result to the query result.{td}{tr}{tbody}{tbody}{tr}{td}[QBResult]{td}{td}[#add]\(func, alias) Add a function with alias result to the query result.{td}{tr}{tbody}{tbody}{tr}{td}[QBResult]{td}{td}[#addPk]\() Add the tables' primary pk columns in alphabetical order to the query result.{td}{tr}{tbody}{tbody}{tr}{td}[QBResult]{td}{td}[#addValue]\(value) Add a value to the query result.{td}{tr}{tbody}{tbody}{tr}{td}[QBResult]{td}{td}[#addValue]\(value, alias) Add a value with an alias to the query result.{td}{tr}{tbody}{tbody}{tr}{td}[QBResult]{td}{td}[#clear]\() Clear the columns in the query result.{td}{tr}{tbody}{table}\\ {table:id=property|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Property Details{th}{tr}{tbody:id=distinct}{tr:id=name}{td}h6.distinct{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get/set the distinct flag for the query.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}

Div
iddescription


HTML Table
id
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#distinct
Get/set the distinct flag for the query.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
QBSelect
Table Cell (td)
#parent
Get query builder parent table clause, this may be a query or a join clause.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
QBSelect
Table Cell (td)
#root
Get query builder parent.

HTML Table
id
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
QBResult
Table Cell (td)
#add(aggregate)
Add an aggregate to the query result.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
QBResult
Table Cell (td)
#add(aggregate, alias)
Add an aggregate with alias to the query result.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
QBResult
Table Cell (td)
#add(column)
Add a column to the query result.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
QBResult
Table Cell (td)
#add(column, alias)
Add a column with alias to the query result.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
QBResult
Table Cell (td)
#add(func)
Add a function result to the query result.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
QBResult
Table Cell (td)
#add(func, alias)
Add a function with alias result to the query result.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
QBResult
Table Cell (td)
#addPk()
Add the tables' primary pk columns in alphabetical order to the query result.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
QBResult
Table Cell (td)
#addValue(value)
Add a value to the query result.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
QBResult
Table Cell (td)
#addValue(value, alias)
Add a value with an alias to the query result.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
QBResult
Table Cell (td)
#clear()
Clear the columns in the query result.

HTML Table
idproperty
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Property Details
Table Body (tbody)
iddistinct
Table Row (tr)
idname
Table Cell (td)
distinct
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get/set the distinct flag for the query.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean
Table Row (tr)
idsam
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
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
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)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idadd-QBAggregate_String
}{
Table Row (tr)
:
id
=
name
}{td}h6.add{td}{tr}{tr:id=sig}{td}{span:style=
Table Cell (td)
add
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right:
5px;
}[
QBResult
]{span}{span:style=
Span
stylefont-weight:
bold;
}
add
{span}{span}\
Span
(aggregate,
alias)
{span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Add an aggregate with alias to the query result.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[QBAggregate]} aggregate -- the aggregate to add to result \{[String]} alias -- aggregate alias {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBResult]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
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')
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=add-QBColumn}{tr:id=name}{td}h6.add{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[QBResult]{span}{span:style=font-weight: bold;}add{span}{span}\(column){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Add a column to the query result.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[QBColumn]} column -- column to add to result {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBResult]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
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)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idadd-QBColumn_String
}{
Table Row (tr)
:
id
=name}{td}h6.add{td}{tr}{tr:id=sig}{td}{span:style=
name
Table Cell (td)
add
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right:
5px;
}[
QBResult
]{span}{span:style=
Span
stylefont-weight:
bold;
}
add
{span}{span}\
Span
(column,
alias)
{span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Add a column with alias to the query result.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[QBColumn]} column -- column to add to result \{[String]} alias -- column alias {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBResult]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
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')
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=add-QBFunction}{tr:id=name}{td}h6.add{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[QBResult]{span}{span:style=font-weight: bold;}add{span}{span}\(func){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Add a function result to the query result.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[QBFunction]} func -- the function to add to the result {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBResult]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
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())
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idadd-QBFunction_String
}{
Table Row (tr)
:
id
=
name
}{td}h6.add{td}{tr}{tr:id=sig}{td}{span:style=
Table Cell (td)
add
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right:
5px;
}[QBResult]{span}{span:style=
QBResult
Span
stylefont-weight:
bold;
}
add
{span}{span}\
Span
(func,
alias)
{span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Add a function with alias result to the query result.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[QBFunction]} func -- the function to add to the result \{[String]} alias -- function alias {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBResult]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
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')
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addPk}{tr:id=name}{td}h6.addPk{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[QBResult]{span}{span:style=font-weight: bold;}addPk{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Add the tables' primary pk columns in alphabetical order to the query result.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBResult]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
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()
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addValue-Object}{tr:id=name}{td}h6.addValue{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[QBResult]{span}{span:style=font-weight: bold;}addValue{span}{span}\(value){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Add a value to the query result.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} value -- value add to result {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBResult]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
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)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idaddValue-Object_String
}{
Table Row (tr)
:
id
=
name
}{td}h6.addValue{td}{tr}{tr:id=sig}{td}{span:style=
Table Cell (td)
addValue
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right:
5px;
}[QBResult]{span}{span:style=
QBResult
Span
stylefont-weight:
bold;
}
addValue
{span}{span}\
Span
(value,
alias)
{span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Add a value with an alias to the query result.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} value -- value add to result \{[String]} alias -- value alias {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBResult]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
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')
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=clear}{tr:id=name}{td}h6.clear{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[QBResult]{span}{span:style=font-weight: bold;}clear{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Clear the columns in the query result.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBResult]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
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()
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
Table Row (tr)
classlastDetailRow
Table Cell (td)