ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pavel Tupitsyn <ptupit...@apache.org>
Subject Re: How can I perform SqlFieldsQuery on DateTime field (binary cache)?
Date Mon, 27 Mar 2017 08:57:46 GMT
Hi, this is Ignite.NET, right?

You should always use SQL parameters:

var rows = _cache.QueryFields(new SqlFieldsQuery("select productid,
recorddate, inventory from product where inventory > ?", 10));

With DateTime just make sure it is UTC:

var rows = _cache.QueryFields(new SqlFieldsQuery("select productid,
recorddate, inventory from product where recorddate > ?", new
DateTime(2016, 03, 27, 0, 0, 0, DateTimeKind.Utc)));

On Mon, Mar 27, 2017 at 11:47 AM, ozgurnevres <ozgur.nevres@gmail.com>
wrote:

> My query is:
>
> var rows = _cache.QueryFields(new SqlFieldsQuery("select productid,
> recorddate, inventory from product where recorddate > '2016-03-27'"));
>
> and I get the exception below:
> Failed to run map query remotely
>
> but this works:
> var rows = _cache.QueryFields(new SqlFieldsQuery("select productid,
> recorddate, inventory from product where inventory > 10"));
>
> Thanks
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/How-can-I-perform-SqlFieldsQuery-on-
> DateTime-field-binary-cache-tp11457.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>

Mime
View raw message