Execute Query

Construct the Query

You must construct a ZCQL query on the required data set before you execute it. A sample SELECT query is shown below:

    
copy
//Construct the query to execute let query ='SELECT * FROM ShipmentData'; let s= await zcql.executeZCQLQuery(query);

Execute the Query

The query object created in the step above is passed to the executeZCQLQuery() method. The zcql reference used here is the component instance defined earlier.

This 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. The response is the same for both versions of Node.js.

Node JS

    
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 2023-09-03 01:06:41 +0530 +0530