Hi there,
I have a simple TIMESTAMP column. EF and Oracle can successfully roundtrip fractions of the seconds. However, if I use my TIMESTAMP column in queries, generated SQL looks dead wrong.
Timestamp columns are filled with SysTimeStamp Oracle function by default, so yes, these values are real.
Here is an example:
SELECT ....
FROM TINDEXES "Extent1"
WHERE "Extent1".TS > TO_TIMESTAMP('2013-06-29 20:14:58.7230000', 'yyyy-mm-dd hh24:mi:ss.ff')
ORDER BY "Extent1".ID ASC
Obviously fractions of seconds get axed, so business logic fails.
Where can one configure the precision of this 'yyyy-mm-dd hh24:mi:ss.ff' format?
EF4/.NET 4/Oracle 11G R2
Thank you in advance,
Lex
TIMESTAMP Precision axed
Re: TIMESTAMP Precision axed
Could you please send us a small test project with the corresponding DDL/DML script to reproduce the issue in our environment?
Re: TIMESTAMP Precision axed
CREATE TABLE BLA (TS TIMESTAMP)
Some model for this table (DateTime column for TS)
var ts = DateTime.Now;
from bla in context.Blas where bla.Ts > ts select bla;
See resulting SQL:
SELECT
...
WHERE t.TS > TO_TIMESTAMP('2013-07-18 13:35:23.7230000', 'yyyy-mm-dd hh24:mi:ss.ff')
Where does DateTime format 'yyyy-mm-dd hh24:mi:ss.ff' come from? Is it hard coded?
Some model for this table (DateTime column for TS)
var ts = DateTime.Now;
from bla in context.Blas where bla.Ts > ts select bla;
See resulting SQL:
SELECT
...
WHERE t.TS > TO_TIMESTAMP('2013-07-18 13:35:23.7230000', 'yyyy-mm-dd hh24:mi:ss.ff')
Where does DateTime format 'yyyy-mm-dd hh24:mi:ss.ff' come from? Is it hard coded?
Re: TIMESTAMP Precision axed
We cannot reproduce the generation of such SQL. Please send us a small test project.Alladin wrote:SELECT
...
WHERE t.TS > TO_TIMESTAMP('2013-07-18 13:35:23.7230000', 'yyyy-mm-dd hh24:mi:ss.ff')
Re: TIMESTAMP Precision axed
I've upgraded dotConnect, replaced WCF OData endpoints with custom ones, simplified queries - now everything works as expected.