Child pages
  • QBSelect

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
{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 '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}[QBLogicalCondition]{td}{td}[#and] Create an AND\-condition to add conditions to.{td}{tr}{tbody}{tbody}{tr}{td}[QBColumns]{td}{td}[#columns] Get columns from query{td}{tr}{tbody}{tbody}{tr}{td}[QBFunctions]{td}{td}[#functions] Get the functions clause from a query, used for functions that are not tied to a column.{td}{tr}{tbody}{tbody}{tr}{td}[QBGroupBy]{td}{td}[#groupBy] Get the group by clause from a query{td}{tr}{tbody}{tbody}{tr}{td}[QBLogicalCondition]{td}{td}[#having] Get the having\-part of the query, used to add conditions.{td}{tr}{tbody}{tbody}{tr}{td}[QBJoins]{td}{td}[#joins] Get the joins clause of this table based clause.{td}{tr}{tbody}{tbody}{tr}{td}[QBLogicalCondition]{td}{td}[#or] Create an OR\-condition to add conditions to.{td}{tr}{tbody}{tbody}{tr}{td}[QBParameters]{td}{td}[#params] Get the named parameters from a query.{td}{tr}{tbody}{tbody}{tr}{td}[QBTableClause]{td}{td}[#parent] Get query builder parent table clause, this may be a query or a join clause.{td}{tr}{tbody}{tbody}{tr}{td}[QBResult]{td}{td}[#result] Get the result part of the query, used to add result columns or values.{td}{tr}{tbody}{tbody}{tr}{td}[QBSelect]{td}{td}[#root] Get query builder parent.{td}{tr}{tbody}{tbody}{tr}{td}[QBSorts]{td}{td}[#sort] Get the sorting part of the query.{td}{tr}{tbody}{tbody}{tr}{td}[QBWhereCondition]{td}{td}[#where] Get the where\-part of the query, used to add conditions.{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}[QBSelect]{td}{td}[#clearHaving]\() Clear the having\-part of the query.{td}{tr}{tbody}{tbody}{tr}{td}[QBCondition]{td}{td}[#exists]\() Get an exists\-condition from a subquery{td}{tr}{tbody}{tbody}{tr}{td}[QBColumn]{td}{td}[#getColumn]\(name) Get a column from the table.{td}{tr}{tbody}{tbody}{tr}{td}[QBColumn]{td}{td}[#getColumn]\(columnTableAlias, name) Get a column from the table with given alias.{td}{tr}{tbody}{tbody}{tr}{td}[QBParameter]{td}{td}[#getParameter]\() Get or create a parameter for the query, this used to parameterize queries.{td}{tr}{tbody}{tbody}{tr}{td}[QBCondition]{td}{td}[#not]\(cond) Create an negated condition.{td}{tr}{tbody}{tbody}{tr}{td}[QBCondition]{td}{td}[#not]\(cond) Create an negated condition.{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=and}{tr:id=name}{td}h6.and{td}{tr}{tr:id=des}{td}{div:class=sIndent}Create an AND\-condition to add conditions to.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBLogicalCondition]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}

GENERATOR.

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)
QBLogicalCondition
Table Cell (td)
and
Create an AND-condition to add conditions to.
Table Row (tr)
Table Cell (td)
QBColumns
Table Cell (td)
columns
Get columns from query
Table Row (tr)
Table Cell (td)
QBFunctions
Table Cell (td)
functions
Get the functions clause from a query, used for functions that are not tied to a column.
Table Row (tr)
Table Cell (td)
QBGroupBy
Table Cell (td)
groupBy
Get the group by clause from a query
Table Row (tr)
Table Cell (td)
QBLogicalCondition
Table Cell (td)
having
Get the having-part of the query, used to add conditions.
Table Row (tr)
Table Cell (td)
QBJoins
Table Cell (td)
joins
Get the joins clause of this table based clause.
Table Row (tr)
Table Cell (td)
QBLogicalCondition
Table Cell (td)
or
Create an OR-condition to add conditions to.
Table Row (tr)
Table Cell (td)
QBParameters
Table Cell (td)
params
Get the named parameters from a query.
Table Row (tr)
Table Cell (td)
QBTableClause
Table Cell (td)
parent
Get query builder parent table clause, this may be a query or a join clause.
Table Row (tr)
Table Cell (td)
QBResult
Table Cell (td)
result
Get the result part of the query, used to add result columns or values.
Table Row (tr)
Table Cell (td)
QBSelect
Table Cell (td)
root
Get query builder parent.
Table Row (tr)
Table Cell (td)
QBSorts
Table Cell (td)
sort
Get the sorting part of the query.
Table Row (tr)
Table Cell (td)
QBWhereCondition
Table Cell (td)
where
Get the where-part of the query, used to add conditions.



HTML Table
id
classservoy sSummary
Colgroup Tag
Col
width80px
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Row (tr)
Table Cell (td)
QBSelect
Table Cell (td)
clearHaving()
Clear the having-part of the query.
Table Row (tr)
Table Cell (td)
QBCondition
Table Cell (td)
exists()
Get an exists-condition from a subquery
Table Row (tr)
Table Cell (td)
QBColumn
Table Cell (td)
getColumn(name)
Get a column from the table.
Table Row (tr)
Table Cell (td)
QBColumn
Table Cell (td)
getColumn(columnTableAlias, name)
Get a column from the table with given alias.
Table Row (tr)
Table Cell (td)
QBParameter
Table Cell (td)
getParameter()
Get or create a parameter for the query, this used to parameterize queries.
Table Row (tr)
Table Cell (td)
QBCondition
Table Cell (td)
not(cond)
Create an negated condition.
Table Row (tr)
Table Cell (td)
QBCondition
Table Cell (td)
not(cond)
Create an negated condition.



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)
idand
Table Row (tr)
idname
Table Cell (td)

and

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create an AND-condition to add conditions to.
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
query.where.add(
	  query.or
	    .add(
	      query.and
		    .add(query.columns.flag.eq(1))
	    .add(query.columns.order_date.isNull)
		 )
	    .add(
	      query.and
	        .add(query.columns.flag.eq(2))
	        .add(query.column.order_date.gt(new Date()))
	     )
	);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=columns}{tr:id=name}{td}h6.columns{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get columns from query{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBColumns]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idcolumns
Table Row (tr)
idname
Table Cell (td)

columns

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get columns from query
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
foundset.getQuery().columns
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=functions}{tr:id=name}{td}h6.functions{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get the functions clause from a query, used for functions that are not tied to a column.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBFunctions]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idfunctions
Table Row (tr)
idname
Table Cell (td)

functions

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the functions clause from a query, used for functions that are not tied to a column.
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.shipname.upper.eq(query.functions.upper('servoy'))) //$NON-NLS-1$
foundset.loadRecords(query)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=groupBy}{tr:id=name}{td}h6.groupBy{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get the group by clause from a query{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBGroupBy]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgroupBy
Table Row (tr)
idname
Table Cell (td)

groupBy

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the group by clause from a query
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders')
query.groupBy.addPk() // have to group by on pk when using having-conditions in (foundset) pk queries
.root.having.add(query.joins.orders_to_order_details.columns.quantity.count.eq(0))
foundset.loadRecords(query)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=having}{tr:id=name}{td}h6.having{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get the having\-part of the query, used to add conditions. The conditions added here are AND\-ed.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBLogicalCondition]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idhaving
Table Row (tr)
idname
Table Cell (td)

having

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the having-part of the query, used to add conditions.
The conditions added here are AND-ed.
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders')
query.groupBy.addPk() // have to group by on pk when using having-conditions in (foundset) pk queries
.root.having.add(query.joins.orders_to_order_details.columns.quantity.count.eq(0))
foundset.loadRecords(query)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=joins}{tr:id=name}{td}h6.joins{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get the joins clause of this table based clause. Joins added to this clause will be based on this table clauses table.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBJoins]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idjoins
Table Row (tr)
idname
Table Cell (td)

joins

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the joins clause of this table based clause.
Joins added to this clause will be based on this table clauses table.
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
foundset.getQuery().joins
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=or}{tr:id=name}{td}h6.or{td}{tr}{tr:id=des}{td}{div:class=sIndent}Create an OR\-condition to add conditions to.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBLogicalCondition]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idor
Table Row (tr)
idname
Table Cell (td)

or

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create an OR-condition to add conditions to.
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
query.where.add(
	  query.or
	    .add(
	      query.and
		    .add(query.columns.flag.eq(1))
	    .add(query.columns.order_date.isNull)
		 )
	    .add(
	      query.and
	        .add(query.columns.flag.eq(2))
	        .add(query.column.order_date.gt(new Date()))
	     )
	);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=params}{tr:id=name}{td}h6.params{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get the named parameters from a query.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBParameters]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idparams
Table Row (tr)
idname
Table Cell (td)

params

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the named parameters from a query.
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
	var query = databaseManager.createSelect('db:/example_data/orders')
	query.where.add(query.columns.contact_id.eq(query.getParameter('mycontactid')))

	// load orders where contact_id = 100
	query.params['mycontactid'] = 100
	foundset.loadRecords(query)

	// load orders where contact_id = 200
	query.params['mycontactid'] = 200
	foundset.loadRecords(query)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=parent}{tr:id=name}{td}h6.parent{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get query builder parent table clause, this may be a query or a join clause.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBTableClause]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
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
QBTableClause
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)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=result}{tr:id=name}{td}h6.result{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get the result part of the query, used to add result columns or values.{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)
idresult
Table Row (tr)
idname
Table Cell (td)

result

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the result part of the query, used to add result columns or values.
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.company_id).add(query.columns.customerid)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=root}{tr:id=name}{td}h6.root{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get query builder parent.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBSelect]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
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)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=sort}{tr:id=name}{td}h6.sort{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get the sorting part of the query.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBSorts]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsort
Table Row (tr)
idname
Table Cell (td)

sort

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the sorting part of the query.
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders')
query.sort
.add(query.joins.orders_to_order_details.columns.quantity.desc)
.add(query.columns.companyid)
foundset.loadRecords(
query) {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=where}{tr:id=name}{td}h6.where{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get the where\-part of the query, used to add conditions. The conditions added here are AND\-ed.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBWhereCondition]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
query)
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idwhere
Table Row (tr)
idname
Table Cell (td)

where

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the where-part of the query, used to add conditions.
The conditions added here are AND-ed.
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
var query = foundset.getQuery()
query.where.add(query.columns.flag.eq(1))
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\ {table:id=function|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=clearHaving}{tr:id=name}{td}h6.clearHaving{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[QBSelect]{span}{span:style=font-weight: bold;}clearHaving{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Clear the having\-part of the query.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBSelect]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 



HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Details
Table Body (tbody)
idclearHaving
Table Row (tr)
idname
Table Cell (td)

clearHaving

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBSelect
Span
stylefont-weight: bold;
clearHaving
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Clear the having-part of the query.
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
var q = foundset.getQuery()
q.where.add(q.columns.x.eq(100))
query.groupBy.clear.root.clearHaving()
foundset.loadRecords(q
); {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=exists}{tr:id=name}{td}h6.exists{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[QBCondition]{span}{span:style=font-weight: bold;}exists{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get an exists\-condition from a subquery{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBCondition]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idexists
Table Row (tr)
idname
Table Cell (td)

exists

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBCondition
Span
stylefont-weight: bold;
exists
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get an exists-condition from a subquery
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
foundset.query.where.add(query.exists(query2))
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getColumn-String}{tr:id=name}{td}h6.getColumn{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[QBColumn]{span}{span:style=font-weight: bold;}getColumn{span}{span}\(name){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get a column from the table.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} name -- the name of column to get {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBColumn]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetColumn-String
Table Row (tr)
idname
Table Cell (td)

getColumn

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBColumn
Span
stylefont-weight: bold;
getColumn
Span
(name)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get a column from the table.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} name - the name of column to get
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
foundset.getQuery().getColumn('orderid')
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetColumn-String_String
}{
Table Row (tr)
:
id
=
name
}{td}h6.getColumn{td}{tr}{tr:id=sig}{td}{span:style=
Table Cell (td)

getColumn

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right:
5px;
}[
QBColumn
]{span}{span:style=
Span
stylefont-weight:
bold;
}
getColumn
{span}{span}\
Span
(columnTableAlias,
name)
{span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get a column from the table with given alias. The alias may be of the main table or any level deep joined table.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} columnTableAlias -- the alias for the table \{[String]} name -- the name of column to get {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBColumn]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get a column from the table with given alias.
The alias may be of the main table or any level deep joined table.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} columnTableAlias - the alias for the table
{String} name - the name of column to get
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
foundset.getQuery().getColumn('orderid', 'opk')
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getParameter}{tr:id=name}{td}h6.getParameter{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[QBParameter]{span}{span:style=font-weight: bold;}getParameter{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get or create a parameter for the query, this used to parameterize queries.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBParameter]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetParameter
Table Row (tr)
idname
Table Cell (td)

getParameter

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBParameter
Span
stylefont-weight: bold;
getParameter
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get or create a parameter for the query, this used to parameterize queries.
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
	var query = databaseManager.createSelect('db:/example_data/orders')
	query.where.add(query.columns.contact_id.eq(query.getParameter('mycontactid')))

	// load orders where contact_id = 100
	query.params['mycontactid'] = 100
	foundset.loadRecords(query)

	// load orders where contact_id = 200
	query.params['mycontactid'] = 200
	foundset.loadRecords(
query) {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=not-QBCondition}{tr:id=name}{td}h6.not{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[QBCondition]{span}{span:style=font-weight: bold;}not{span}{span}\(cond){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Create an negated condition.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[QBCondition]} cond -- the condition to negate {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBCondition]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
query)
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idnot-QBCondition
Table Row (tr)
idname
Table Cell (td)

not

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBCondition
Span
stylefont-weight: bold;
not
Span
(cond)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create an negated condition.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{QBCondition} cond - the condition to negate
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
foundset.query.where.add(query.not(query.columns.flag.eq(1)))
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=not-QBLogicalCondition}{tr:id=name}{td}h6.not{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[QBCondition]{span}{span:style=font-weight: bold;}not{span}{span}\(cond){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Create an negated condition.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[QBLogicalCondition]} cond -- the logical condition to negate {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBCondition]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idnot-QBLogicalCondition
Table Row (tr)
idname
Table Cell (td)

not

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBCondition
Span
stylefont-weight: bold;
not
Span
(cond)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create an negated condition.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{QBLogicalCondition} cond - the logical condition to negate
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
foundset.query.where.add(query.not(query.columns.flag.eq(1)))
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
Table Row (tr)
classlastDetailRow
Table Cell (td)