So, I need to know if 20 minutes have passed, but, working with timestamps is proving that I'm not good at pl/sql
This is my query
SELECT
systimestamp currenttime,
lockeddtts original,
lockeddtts + to_number( (
SELECT
value
FROM
configurationTable
WHERE
key = 'UNLOCK_TIME'
) ) * INTERVAL '1' MINUTE added20,
CASE
WHEN systimestamp > lockeddtts + to_number( (
SELECT
value
FROM
configurationTable
WHERE
key = 'UNLOCK_TIME'
) ) * INTERVAL '1' MINUTE THEN 1
ELSE 0
END
passed20
FROM
xTable
And this is the result I get
From my understanding and my logic, currentTime is indeed greater than original time plus 20 minutes, still, oracle tells its not
What am I missing?
I'm doing this oracle wise in order to use oracle server time rather than backend server so not to mess with time zones, and still, it's not cooperating with me
Edit:
Thanks to @Kjetil S. for the answer, I just need to tweak it a little for it to work, converting the date sumatory to timestamp and it's working
This was my end query
SELECT
CASE
WHEN systimestamp > to_timestamp(lockeddtts + to_number( (
SELECT
value
FROM
configurationTable
WHERE
key = 'UNLOCK_TIME'
) ) / ( 24 * 60 )) THEN 1
ELSE 0
END
passed20
FROM
xTable
Proof it works
Thanks and hope this works for someone else