I'm a confessed PL/SQL neophyte here but I have a question as to best handle setting a Postdate to the Sysdate and time an interface job runs at night or morning to the following:
The client wants the following scenario:
Set the OHPost date to be the date as of the closest midnight to the time of execution. Eg. If the interface is run on 10/31/06 at 23:55,then set the OHPost to 11/1/06 00:01. If the interface is run on 11/1/06 at 00:55,then set the OHPost to 11/1/06 00:01.
I interpret this as meaning if the sysdate & time is > 12:00 PM then set the OHPOSTDATE := SYSDATE +1 || ’00:01” AM)
-- ie. The next day at 12:00:01 AM.
else
set the OHPOSTDATE := SYSDATE || ’00:01” AM)
This is being selected from dual in a PL/SQL procedure.
Nearest midnight: won't TRUNC(sysdate + 0.5)+1/(24*60) do that?
"The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman
Thanks all ofr the responses. I'll test it out. It's the test of checking for the current time being before or after 12 PM in the statement that needs to be tested. Thanks again for your suggestions.
Bookmarks