I use H2 for testing and I want to set sysdate
.
I tried to create an alias for sysdate
to my own implementation, but then I couldn't use it with arithmetic like sysdate - ?
. There was exception: Unknown data type: "?"
I tried to replace sysdate
string to smth like timestamp '2018-01-01 11:11:11.123'
or parsedatetime('2018-01-01 11:11:11.123', 'yyyy-MM-dd hh:mm:ss.SSS')
in runtime. There was same exception, like in previous attempt.
Yes, I can add cast(? as number)
to all my sql, but it isn't a good solution for me.
Do you have any idea, how can I do this?
ps: I also use Spring. Maybe it will help
If you use two databases at once, you should avoid usage of vendor-specific syntax.
You can use SQL Standard-compliant
LOCALTIMESTAMP - INTERVAL '30' MINUTE
in recent versions of Oracle and H2.
I already had this problem and that was the solution it worked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With