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:45:01 -0400
Message-ID: <f028a$428d7790$4528c826$21189@ALLTEL.NET>


Werner Hofmann wrote:

>>1) Lookup usage for pragma autonomous_transaction at
>>http://tahiti.oracle.com
>>2) What's the point of using a sequence when you are going to reset it
>>everytime you insert/delete a row?
>>
>>Regards
>>/Rauf

>
>
> Hallo Rauf,
>
> I don't reset the sequence every time the trigger is called, but I have some
> code, which is automatically cleaning the content of the table. And in the
> case the cleaner has deleted all rows, then I wanted to reset the trigger.
>
> In the firebird database I can reset the Generator(sequence) - no problem,
> but oracle won't like my idea. So, if 1) is not my solution, in last
> consequence I habe to reset the sequence outside the trigger anywhere in
> the code.
>
> Thank you,
> Werner

You don't reset the trigger, you reset the sequence.

Why can't you do it in your code that does the automatic cleaning??

Ed

-- 
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:45:01 CDT

Original text of this message

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