Post 8i, use timestamps.

If you are Oracle 8i or earlier, you should probably use a date field.

Here are two options:

1.   Use to_date('10:10','HH:mi') to store the time in the Oracle
database.  This will insert the current date in the date portion but you
can retreive the time using to_char(date_field 'HH:mi');

2.  Use to_date('01/01/0001','MM/DD/YYYY') + :hour/24 + :minute/1440  to
store the time in the Oracle database.  This will allow you to add/subtract
time and get the time difference in fractional days.   To retrieve the time
use to_char(datefield, 'HH:mi').

Hope this helps.

Janet.

At 09:01 AM 7/13/2004 -0400, you wrote:
>I have to record a time in a DB.  It would seem that I'd do that with
>createTime.  I have just a few simple questions.
>In the Oracle DB, do I make a date field as usual and populate it
>with yr/mo/da = 0,0,0 and then insert the createTime variable in one
>block?   Is there maybe a time type for a field? (I suppose not).
>IOW, how is just time, where no date is needed, handled?
>
>--
>Daniel Kessler
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to