rbv_api.selectQuery2()
Purpose
Similar to selectQuery(),selectQuery2() runs a query and
returns the results as a 2D-array. The extra parameter, rowFrom, defines
a starting point for results. This makes it possible to make several calls for objects that
contain thousands of rows of data.
The SELECT query used in this method consists of the following parts:
- The SELECT statement expects columns or expressions to be selected (mandatory). Use the field integration names as SQL column names. You can use expressions such as COUNT(1). You cannot use * to retrieve all columns.
- The FROM clause must consist of exactly one object name (mandatory).
- The WHERE clause can include a valid SQL expression to narrow the selection (optional). Use field integration names as SQL column names.
- The ORDER BY clause can include a valid SQL expression to order the selection (optional). Use field integration names as SQL column names.
You can use special tokens in your queries such as:
- TODAY for current time
- WEEK for 12PM of last Sunday
- MONTH for 12PM of 1st day of current month
- QUARTER for 12PM of 1st day of current quarter
- YEAR for 12PM of 1st day of current year
- CURR_USER for id of currently logged in user
Object and Field names are case-sensitive, while other components of the SQL query are not.
Use #code suffix to fetch integration codes for picklist fields rather than IDs. See Adding business logic for more information.
Syntax
rbv_api.selectQuery2 (query, rowFrom, maxRows, arg1, arg2…)
Parameters
query
SQL SELECT query. See Query API for examples and limitations.
rowFrom
Number of row to start output (0 based)
maxRows
Maximum number of rows to retrieve (1-20,000 range)
args
Variable number of parameters passed to query (optional)
Return value
Query result in a 2-D array
Permissions required
View permission for the selected object type.
Query API LIMIT Clause
This API now automatically applies an implicit LIMIT clause to parsed SQL queries to improve performance. Manual LIMIT or OFFSET clauses in query inputs are no longer recommended and will be unsupported in future platform releases.
Post-Migration guidance
-
Remove any manual LIMIT clauses from queries used with these APIs.
-
After upgrading to Platform v6.11.7.1, review deprecated queries by navigating to Customer > View Logs > sql_deprecation.log. A System Administrator can access this log.