You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by "javastuff.sam@gmail.com" <ja...@gmail.com> on 2017/04/22 01:12:52 UTC
SQLQuery and Datatypes
Hi
My cached object is Binarylizable. I am using SQLQuery and SQLFieldQuery.
In some cases I need to query on a hardcoded/fixed filter e.g. Name = 'xyz'.
Same usecase for Long, Date, TimeStamp datatype as well.
Basically not using setArgs().
I see it works fine for String, Int, Long.
- Can I use formatted string for Date, Timestamp and Boolean datatypes?
- If yes - What format for Date and Timestamp? Is there any disadvantages
because not using proper datatype and setArg?
Thanks,
-Sam
--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/SQLQuery-and-Datatypes-tp12167.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: SQLQuery and Datatypes
Posted by Sergi Vladykin <se...@gmail.com>.
Hi,
Look here
http://h2database.com/html/grammar.html#time
Sergi
2017-04-24 21:28 GMT+03:00 javastuff.sam@gmail.com <ja...@gmail.com>
:
> It would be helpful to understand how the date and timestamp are stored
> with
> writeDate and writeTimestamp specifically for the format perspective. So
> that I can create queries on the same line if I choose not to use setArgs.
>
> Thanks,
> -Sam
>
>
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/SQLQuery-and-Datatypes-tp12167p12210.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>
Re: SQLQuery and Datatypes
Posted by "javastuff.sam@gmail.com" <ja...@gmail.com>.
It would be helpful to understand how the date and timestamp are stored with
writeDate and writeTimestamp specifically for the format perspective. So
that I can create queries on the same line if I choose not to use setArgs.
Thanks,
-Sam
--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/SQLQuery-and-Datatypes-tp12167p12210.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: SQLQuery and Datatypes
Posted by vdpyatkov <vl...@gmail.com>.
Hi,
I think it will be possible for java.util.Date, but you you are should
format date which was been understanding by H2 db.
But you can use constants as parameters and it will be more flexible.
For dynamic SQL parameters are useful when more then one query generated
with on query text, but various parameters.
For static SQL it always been workarounded.
--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/SQLQuery-and-Datatypes-tp12167p12200.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.