Volt MX Foundry console User Guide: Application-level APIs > VMXFoundry.OfflineObjects.executeSelectQuery
VMXFoundry.OfflineObjects.executeSelectQuery
The application-level API, executeSelectQuery allows the user to execute any select query on device database. The API executes the query provided as an argument on the device database and returns the response in successCallback.
The failureCallback is invoked in case of errors such as invalid query and so on.
Note: executeSelectQuery should be preferred only if the object-level read API is not able to serve the purpose such as join based select queries or complex SQL queries.
Note: executeSelectQuery supports only read or select queries. The API does not support create or update or delete operations on the device database.
Volt MX Iris (JavaScript)
Note: Not supported for Mobile Web, and Desktop Web channels.
Signature
Parameters
Parameter | Type | Description | Required |
---|---|---|---|
query | String | Select query to be executed on device DB. | Yes |
successCallback | Function | The function is invoked upon successful query execution. | Yes |
failureCallback | Function | The function is invoked on failure. | Yes |
Return Type
void
Example
Android (Java)
Signature
Parameters
Parameter | Type | Description | Required |
---|---|---|---|
query | String | Select query to be executed on device DB. | Yes |
callback | VMXCallback | The application must implement onSuccess and onFailure methods of VMXCallback interface. | Yes |
Return Type
void
Example
iOS (Objective C)
Signature
Parameters
Parameter | Type | Description | Required |
---|---|---|---|
query | NSString* | Select the query to be executed on device DB. | Yes |
onSuccess | VMXSuccessCompletionHandler | The function is invoked on successful query execution. | Yes |
onFailure | VMXFailureCompletionHandler | The function is invoked on failure. | Yes |
Return Type
void