Hi,

Here is a small example that works for me:

        IgniteCache<?, ?> cache = grid(1).cache("person");

        cache.put(1, new Person("sun", 100));
        cache.put(2, new Person("moon", 50));

        String sql =
            "UPDATE person" +
                "   SET name = ?" +
                " WHERE age > 10;";

        Object nullPtr = null; //it's important because just null will be
parsed as args[] = null instead of args[0] = null;

        cache.query(new SqlFieldsQuery(sql).setArgs(nullPtr));

        SqlFieldsQuery qry = new SqlFieldsQuery("select age from person
where name is null;");

        FieldsQueryCursor<List&lt;?>> qryCursor = cache.query(qry);

        Iterator<List&lt;?>> iterator = qryCursor.iterator();

        while (iterator.hasNext()) {
            List row = iterator.next();

            System.out.println("    >>> Age " + row.get(0));
        }

Result:

    >>> Age 100
    >>> Age 50

BR,
Andrei



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Reply via email to