I am developing some data interface loading and computing data from the previous day (today-1) running everyday.
For obvious reason I am currently running it into production conditions, and I have to deal with some set of old data.
So any sysdate()-1 need to be adjusted everyday, which is pretty heavy to do (especially when you have to deal with data from 2011).
There is a way to modify sysdate into Oracle for tests purpose (we put a fix value into sysdate, then after the test we get sysdate() back to the proper value) :
http://nuijten.blogspot.sg/2010/11/chan ... sting.html
I haven't seen any option into the documentation but I might have missed something.
Is it possible ?
Another way would be to set an internal variable and replace every sysdate() by it :
Code: Select all
\set test '''11-11-2015 11:11:11'''::timestamp
select to_timestamp(:test, 'DD/MM/YYYY HH24:MI:SS') -1 as test;
But it implies pretty heavy changes into my scripts just for testing so I would like to avoid this.
Thank you.