Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: "Delta" or "elapsed" time column in Oracle

Re: "Delta" or "elapsed" time column in Oracle

From: Bill McLaughlin <mcbill20_at_hotmail.com>
Date: 7 Jun 2004 19:51:34 -0700
Message-ID: <e9cbc4f2.0406071851.35ee93ec@posting.google.com>


"David Best" <davebest_at_usa_dot_net> wrote in message news:<Gc2dnfzu2upRK13d4p2dnA_at_speakeasy.net>...
>
> I would recommend more experimentation before you settle on an approach;
> interval types have many limitations. Here's a function that can help your
> calculations:
>
> -- converts interval day to second to number of seconds
> function dsintervaltonum(val dsinterval_unconstrained) return number is
> begin
> return extract(day from val) * secs_per_day + extract(hour from val) *
> secs_per_hour + extract(minute from val) * secs_per_minute + extract(second
> from val);
> end;
>
> Dave

Thanks again to both of you. I agree that I need to do some more experimentation before deciding on a particular format. Right now I am going to add a "seconds" column and see how much work it is to get the queries and reports I want from that. To be honest, all of the numeric formats available in Oracle confuse me. Most of the programming I have done has been accounting and shop floor type stuff-- calculating times between dates, dollar amounts, etc. rather than integer stuff. I rarely had columns that would only contain whole numbers. So, just about everything I've put together in the past would be a column that is "number(w,f)".

That said, can you point me to a good document that explains the internal formats and recommendations for when to use each type? Most of what I have found so far just gives a brief overview of what _can_ be stored in each format, rather than what _should_ be stored in a particular format.

Thanks. Received on Mon Jun 07 2004 - 21:51:34 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US