Re: Convert Number to Time ?

From: Will <wkooiman_at_earthlink.net>
Date: 29 May 2002 22:52:38 -0700
Message-ID: <7256fcf8.0205292152.f0cf749_at_posting.google.com>


Jon Spartan <jonu_at_ixtech.net> wrote in message news:<1v7oeuo9ul04d4m6p3ptoef507jm51h2go_at_4ax.com>...
> I have an Oracle 8.1.7 DB I must work with and import into MS-SQL. The
> "programmer" has a column TIME ( which I will allow should be some for
> od time or date/time ) which is listed as "number" with a precision of
> 21.
>
> I have to convert this to an MS-SQL datetime column.
>
> Is there anyone who may assist me in this, as I am at a total loss as
> Oracle is very new to me ( 4 days and counting )
>
> Many thanks in advance
>
> Jon Spartan

There is a function called dbms_utility.get_time that returns time as a big number. The number can really only be used to compute elapsed time. For example, if you call it once and save the number, then run whatever you are timing, then call it again, you can subtract the numbers and you have elapsed time. It is useful in that it returns time in 1/100ths. Sysdate only goes down to seconds. Your developer is most likely using that function.

You cannot get DATE from the get_time function - only elapsed time.

There's a similar function in Unix. I've always wondered if Oracle is simply returning the Unix value, but I've never checked it out.

Good luck finding a get_time function in MS-SQL. I don't know MS-SQL much at all, but I wouldn't be surprised if you have to resort to VB to do something similar. Received on Thu May 30 2002 - 07:52:38 CEST

Original text of this message