Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: "Delta" or "elapsed" time column in Oracle
"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