I am working with GridDB and trying to execute a SQL query, but I am getting an error. I have created a container and added some data to it. When I try to execute the query, I get an error message saying "Syntax error near 'query'". I have tried multiple times with different queries but getting the same error.
// Connect to GridDB cluster
GridStore *store = GridStoreFactory::get_instance()->get_gridstore("your_ip_address", 31810, "your_cluster_name", "your_username", "your_password");
// Get a collection
Collection<Row> *collection = store->get_collection<Row>("Data");
// Create a query object
Query<Row> queryObj = collection->query("SELECT * FROM your_container_name WHERE your_column_name = 'your_value'");
// Execute the query
RowSet<Row> *rs = queryObj.fetch();
// Iterate over the result set
while (rs->has_next()) {
Row *row = rs->next();
// Do something with the data
}
// Release the resources
delete rs;
delete collection;
store->close();
Griddb::Exception: Code: 4, Reason: GS_ERROR_QUERY_INVALID_SYNTAX, Invalid syntax for the specified query. (unknown error code): query="SELECT * FROM WHERE = 'value'"