Re: Storing Times in Oracle

From: Loyal Barber <lbarber_at_ix.netcom.com>
Date: 1996/10/04
Message-ID: <32550A70.1A46_at_ix.netcom.com>#1/1


Yes, but not as cleanly as you might like. it would be a simple thing to write a set for procedures or functions to give differences in whatever time interval you chose. Lacking that and assuming you had a start tiem and end time for a job run you could:

SELECT (TO_NUMBER(TO_CHAR (time_end,'SSSSS')) -

   TO_NUMBER (TO_CHAR (time_start,'SSSSS'))) / 60 "Minutes Between" FROM my_batch_monitor
WHERE batch_job_run_id = 1;

The to_char converts the time to seconds past midnight. I believe the rest of it is
pretty obvious. A function to do this would not be difficult though you would have
to decide whether to round hours/minutes or have decimal hours/minutes.

loyal Received on Fri Oct 04 1996 - 00:00:00 CEST

Original text of this message