Query DataStore

ZCQL

ZCQL is Catalyst’s own query language that enables you to perform data retrieval, insertion, updating, and deletion operations on the tables in the Catalyst Data Store. You can execute a variety of DML queries using ZCQL to obtain or manipulate data, and use various clauses and statements such as the SQL Join clauses, GroupBy and OrderBy statements, and built-in ZCQL functions.

Note: Ensure you have installed the required package to use this SDK method.

The required query needs to be constructed and passed as a param to the executeZCQLQuery() method to execute it.

Construct the Query

The following example code snippet details constructing a SELECT query and passing it to the executeZCQLQuery() method to execute it. The datastore reference used here is the component instance.

copy
// Construct the query to execute
const query = 'SELECT * FROM ShipmentData';
const result = await datastore.executeZCQLQuery(query);

Example of Expected Response

Executing the ZCQL query using the executeZCQLQuery() SDK method will return a promise, which will be resolved to an object. The content key will contain the array of row objects. A sample response that you will receive is shown below.

copy
[
  {
    AlienCity: {
      CREATORID: "2136000000006003",
      MODIFIEDTIME: "2021-08-13 13:49:19:475",
      CREATEDTIME: "2021-08-13 13:49:19:475",
      CityName: "Dallas",
      ROWID: "2136000000008508"
    }
  },
  {
    AlienCity: {
      CREATORID: "2136000000006003",
      MODIFIEDTIME: "2021-08-16 15:55:32:969",
      CREATEDTIME: "2021-08-16 15:55:32:969",
      CityName: "Los Angeles",
      ROWID: "2136000000011002"
    }
  },
  {
    AlienCity: {
      CREATORID: "2136000000006003",
      MODIFIEDTIME: "2021-08-16 17:03:01:507",
      CREATEDTIME: "2021-08-16 16:29:10:499",
      CityName: "New York",
      ROWID: "2136000000011011"
    }
  }
]

Last Updated 2026-07-02 14:51:41 +0530 IST