Skip to main content

Using Data Query through User Interface

Zuora

Using Data Query through User Interface

The Data Query feature enables you to export data from your Zuora tenant by performing asynchronous, read-only SQL queries. You can create new data queries, save data queries, and view the query history through Data Query UI.

Create new data queries

You can create new data queries through Data Query UI to export data from your Zuora tenant.

To create a new data query:

  1. Navigate to Platform > Data Query in the left navigation menu.
  2. Click CREATE NEW DATA QUERY on the Data Query page.
  3. Enter a SQL query into the text box on the Create Data Query page. See Constructing SQL Queries in Data Query for the supported SQL syntax, the available tables, and sample queries.

  4. Set the query options on the Create Data Query page:

    • USE INDEX JOIN: select the USE INDEX JOIN checkbox if you want to use Index Join in your query. Index join is useful when you have a specific reference value in your WHERE clause to index another large table by. See Use Index Join for more information.

    • READ DELETED: select the READ DELETED checkbox if you want to retrieve only the deleted records. If you do not select the READ DELETED checkbox, the query retrieves only the non-deleted records. 

    • COMPRESSION: select the compression format for the returned query result from the picklist. The supported values are:

      • NONE
      • GZIP
      • ZIP
    • OUTPUT FORMAT: select the output format for the returned query result from the picklist. The supported values are:

      • JSON - Each row in the query results is a JSON object. The format of the query result files is JSON Lines.
      • CSV - Each row in the query results is a comma-separated list of values.
      • TSV - Each row in the query results is a tab-separated list of values.
      • DSV - Each row in the query results is a list of values separated by your custom delimiter. When you select DSV from the picklist, the COLUMN SEPARATOR field is displayed on the right side of the OUTPUT FORMAT field. Input your custom delimiter character into the COLUMN SEPARATOR field.
  5. Click RUN QUERY to submit your new query. Upon completion of the new query, you can click DOWNLOAD to download the query result. To save your new query, click SAVE QUERY.

Save data queries

When you create a new data query through Data Query UI, you can save the query. You can then re-run the saved query in the future without constructing the SQL query again. You can access all the saved queries in your tenant.

To save your query:

  1. Click SAVE QUERY upon completing the construction of your new query on the Create Data Query page.
  2. In the Save Query dialog, input the name and description of the query into the QUERY NAME and DESCRIPTION fields respectively.
  3. Click SAVE.

To view your saved queries:

  1. Navigate to Platform > Data Query.
  2. Click the SAVED QUERIES tab on the Data Query page. The list of saved queries is displayed.

To run a saved query:

  1. Click the query name of the saved query that you want to update in the list of saved queries.
  2. Click RUN QUERY on the query detail page.

To update a saved query:

  1. Click the query name of the saved query that you want to update in the list of saved queries.
  2. Update the query on the query detail page.
  3. Click UPDATE SAVED QUERY.

To delete a saved query:

  1. Hover over the query that you want to delete in the list of saved queries.
  2. Click the trash can icon on the right side of the query.
  3. Click DELETE QUERY in the Delete Saved Query dialog.

View the data query history

You can view the data queries submitted in history through Data Query UI. If you are an administrator, you can view all the data queries submitted in history. Otherwise, you can only view the data queries that you submit in history.

To view the data query history:

  1. Navigate to Platform > Data Query.
  2. Click the HISTORY tab on the Data Query page. The list of data queries that you run in history is displayed.

You can make the following operations upon a data query in history:

  • Download the query result by clicking the download icon if the query job is completed.
  • Cancel the query by clicking the cancel icon if the query job is in the submitted or in progress status. 
  • Create a new data query by clicking the more icon and then clicking Create as New Data Query.