May 03, 2024 09:40 Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients SampleSupported Clients
SmartClient
WebClient
NGClient
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.
Methods 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
addSubSelect(query)
Add a query to the query result.
QBResult
addSubSelect(query, alias)
Add a query with alias to the query result.
QBResult
addSubSelect(customQuery, args)
Add a custom subquery to the query result.
QBResult
addSubSelect(customQuery, args, alias)
Add a custom subquery with alias 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.
Array
getColumns()
returns an array with all the columns that will be in the select of this query.
Property Details
distinct
query.result.distinct = true
parent
var query = datasources.db.example_data.person.createSelect();
query.where.add(query.joins.person_to_parent.joins.person_to_parent.columns.name.eq('john'))
foundset.loadRecords(query)
root
var subquery = datasources.db.example_data.order_details.createSelect();
var query = datasources.db.example_data.orders.createSelect();
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)
Methods Details
add(aggregate)
QBAggregate
aggregate
the aggregate to add to result
query.result.add(query.columns.label_text.max)
add(aggregate, alias)
QBAggregate
aggregate
the aggregate to add to result
String
alias
aggregate alias
query.result.add(query.columns.item_count.max, 'maximum_items')
add(column)
QBColumn
column
column to add to result
query.result.add(query.columns.custname)
add(column, alias)
QBColumn
column
column to add to result
String
alias
column alias
query.result.add(query.columns.custname, 'customer_name')
add(func)
QBFunction
func
the function to add to the result
query.result.add(query.columns.custname.upper())
add(func, alias)
QBFunction
func
the function to add to the result
String
alias
function alias
query.result.add(query.columns.custname.upper(), 'customer_name')
addPk()
query.result.addPk()
addSubSelect(query)
QBSelect
query
query to add to result
// make sure the query returns exactly 1 value.
query.result.addSubSelect(subquery);
addSubSelect(query, alias)
QBSelect
query
query to add to result
String
alias
result alias
// make sure the query returns exactly 1 value.
query.result.addSubSelect(subquery, "mx");
addSubSelect(customQuery, args)
String
customQuery
query to add to result
Array
args
arguments to the query
// make sure the subquery returns exactly 1 value.
// select (select max from othertab where val = 'test') from tab
query.result.addSubSelect("select max from othertab where val = ?", ["test"]);
addSubSelect(customQuery, args, alias)
String
customQuery
query to add to result
Array
args
arguments to the query
String
alias
result alias
// make sure the subquery returns exactly 1 value.
// select (select max from othertab where val = 'test') as mx from tab
query.result.addSubSelect("select max from othertab where val = ?", ["test"], "mx");
addValue(value)
Object
value
value add to result
query.result.addValue(100)
addValue(value, alias)
Object
value
value add to result
String
alias
value alias
query.result.addValue(100, 'myvalue')
clear()
query.result.clear()
getColumns()
var columns = query.result.getColumns();