I had this select statement run right at the midnight break...

SELECT.STATEMENT = 'SELECT TSE USING D.TSE WITH ACT.BATCH.STATUS = "EXTCOMP"
AND WITH COMPLETED # "COMP" OR WITH CALL.IN.DATE LE
"':OCONV(DATE(),'D4/'):'" AND WITH CALL.IN.TIME LE
"':OCONV(TIME(),'MTH'):'"' AND WITH COMPLETED # "COMP"' 

I know the first "OR" clause failed... So it appears that 
The CallInDate received the POST MIDNIGHT DATE -- in this case 04/06/2006
While the CallInTime received the PRE MIDNIGHT TIME - something like
23:59:59
While I did not store the actual command, it's the only structure of this
command that would return the data set processed - and I know that a time
stamp on the run data was at 00:00:12, so this select DID happen right a the
midnight break.

Has anyone ever seen a case like this?  Either the select statement did not
fill in "Left to Right" (is that possible?  The worst case I had already
planned for: a processing loop would get yesterday's date (04/05/2006),
tomorrow's time (00:00:01), and that would ALWAYS return zero records - no
harm no foul - we'll get the records in the next loop!) or **somehow** the
DATE() and TIME() were not updated in order or they were not updated by the
environment as I would have "expected". If TIME() goes to 00:00:00, I expect
the DATE() is also 'right then' updated.

It was a head scratcher why records for today were handled, and I traced it
back to this select as being the only way it could happen.

I know DATE() and TIME() are beasts -- but should I logically every expect
that statements build 'left to right' -- and if that's not the case, can
DATE() and TIME() become 'dis-synchronized'?  Or should I have played the
lottery yesterday since this was also a 1 in 16 billion odds?

My option now is to put this whole process to sleep for 10 seconds at 5
seconds to midnight! Is that too crazy?  I know others do time-aware
processing - how do you ensure this kind of oddness does not occur? Or does
it and you just do the sleep until you know for sure route?

David W.
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to