Using a sequence to force unique DATE field

From: Eric Stephens <eastephe_at_mailbox.syr.edu>
Date: 1995/06/27
Message-ID: <3sprt1$nm1_at_newstand.syr.edu>#1/1


We currently have a set of two tables that are linked together by only a DATE field. Usually, the field can be unique but since O doesn't support milliseconds with the DATE, we sometimes run into PK violations. (And yes, we should have used a SEQUENCE with a NUMBER type column, but that's another story.)

What I'd like to do is stuff the following value into the DATE:

to_date(forrest_gump.nextval,'sssss')

where forrest_gump is a sequence ranging from zero to 86399. The expression above returns the date as being 6/1/95 and then an appropriate number of seconds based on the sequence. Is that normal? Anyone know any better tricks to hack around this problem?

Please respond to the CSC e-mail address below. TIA

Eric A. Stephens
Computer Sciences Corporation, Syracuse, NY USA estephe1_at_csc.com
eastephe_at_mailbox.syr.edu <MIME enabled> http://web.syr.edu/~eastephe Received on Tue Jun 27 1995 - 00:00:00 CEST

Original text of this message