Zuora Object Query Language
From API Documentation
Zuora supports a simple SQL-like query language for use with the query call. A basic familiarity with SQL is needed in order to construct queries; therefore, that basic knowledge is assumed in the following discussions.
Contents |
Syntax
The basic query syntax is:
select field_names from object
select field_names from object where filter_statements
Note: Please keep all keywords lower case.
Complex queries and joining are not supported.
Also, you cannot use the asterisk wild card (*) for field names. Instead, you must explicitly specify a field name.
Zuora does not support infix matching, only prefix and suffix. For example, the following queries are allowed:
select Id from Account where Name like 'Company%'
or:
select Id from Account where Name like '%ompany ABC, Inc.'
but not:
select Id from Account where Name like '%ompany%'
The query returns a maximum of 100 records for versions < 6.0. For versions 6.0+, 2000 records are returned, and you can use queryMore() to page through additional results.
Case Sensitivity
In general, queries are not case sensitive. However, explicit string values are case-sensitive, such as pick-list values. For example "Batch1" for Batch field.
Field Names
The field_names placeholder represents a list of one or more fields that exist in the object. You cannot use single or double quotation marks on the field names. Use a comma to separate one value from the next. For example,
select AccountId, FirstName, LastName from contact where State = 'California'
Objects
The object placeholder represents an object from the Zuora API. Each query can name only one object.
Filter Statements
The filter_statements placeholder represents comparisons being made on different types of data in order to find items matching specified criteria. A filter statement takes the following form:
field_name operator value
For example, in the following query AutoPay is a filter statement:
select AccountNumber from account where AutoPay !=true
The data type of the value must match the field type in the filter statement. Field types are specified in the individual object pages in this documentation.
For more information about filter statements, including the supported operators, see Filter Statements.
