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

Home -> Community -> Usenet -> c.d.o.misc -> Re: reset a sequence in a trigger

Re: reset a sequence in a trigger

From: Ed Prochak <ed.prochak_at_magicinterface.com>
Date: Fri, 20 May 2005 01:47:18 -0400
Message-ID: <2e28$428d781a$4528c826$21189@ALLTEL.NET>


Werner Hofmann wrote:

>>Stupid question maybe but why reset it? A sequence is a large number.
>>Are you try to save numbers? You can set a max value and then cycle
>>it. Resetting a sequence just seems like you're going about solving
>>the wrong problem.
>>
>>Thanks,
>>
>>Lewis
>>

> 
> 
> In this table I have a lot of transactions, and it can be, that the ID which
> is the primary key can overrun after some time (some years). I can not use
> another primary key, because this would be with a VARCHAR2 column. And so I
> wantet to be save, that the oldest entry have the smallest ID for sorting.
> 
> Werner

Then why do't you include a updated_when column on the table? Then sort according to the time it was updated rather than tricking around with pseudo-keys.

-- 
Ed Prochak
running    http://www.faqs.org/faqs/running-faq/
netiquette http://www.psg.com/emily.html
--
"Two roads diverged in a wood and I
I took the one less travelled by
and that has made all the difference."
robert frost
Received on Fri May 20 2005 - 00:47:18 CDT

Original text of this message

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