Is is possible to use update sql queries in ignite?? I have the following
method:
private static void queryChange() {
IgniteCache<AffinityKey<Long>, Person> cache =
Ignition.ignite().cache("PCache");
// Execute query to get names of all employees.
String sql =
"update \"" + ORG_CACHE + "\".Organization set orgname = ? where
exists ( select firstName from Person where Person.orgid =
Organization.orgid and Person.firstName = ?";
QueryCursor<List<?>> cursor1 = cache.query(new
SqlFieldsQuery(sql).setArgs("Morgan Stanley","Marc"));
String sql1 = "select firstName, org.orgname, org.orgid from Person,
\"" + ORG_CACHE + "\".Organization as org where Person.orgid = org.orgid";
QueryCursor<List<?>> cursor = cache.query(new
SqlFieldsQuery(sql1));
// In this particular case each row will have one element with full
name of an employees.
List<List<?>> res = cursor.getAll();
// Print persons' names and organizations' names.
print("Names of all employees and organizations they belong to:",
res);
}
But it is giving me "failed to parse sql query" error.
--
View this message in context:
http://apache-ignite-users.70518.x6.nabble.com/Passing-argument-in-sql-query-under-where-clause-giving-error-tp4164p4179.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.