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

Home -> Community -> Usenet -> c.d.o.tools -> Re: adjust seq

Re: adjust seq

From: <eastking_at_my-deja.com>
Date: Fri, 08 Sep 2000 05:18:19 GMT
Message-ID: <8p9sqg$k3r$1@nnrp1.deja.com>

In article <dYTt5.2064$gD2.80081_at_news1.online.no>,   "dd" <dd_at_pp.no> wrote:
> Have you tried
>
> update seq_table
> set seq=rownum;
>
> Dag
>
> <eastking_at_my-deja.com> wrote in message news:8p722g$9s0
 $1_at_nnrp1.deja.com...
> > In article <8p5om1$atg$1_at_soap.pipex.net>,
> > "Niall Litchfield" <n-litchfield_at_audit-commission.gov.uk> wrote:
> > > Why do you wish to do this? The table you have looks like it has a
 primary
> > > key , generated by means of a sequence. If this is the case why
 does
 the PK
> > > value need to be change at all.
> > > --
> > > Niall Litchfield
> > > Oracle DBA
> > > Audit Commission UK
> > > <eastking_at_my-deja.com> wrote in message
 news:8ov4vf$n3o$1_at_nnrp1.deja.com...
> > > > Hi , every one here.
> > > >
 

> > > > I have a table as following
> > > >
> > > > Seq value
> > > > -----------
> > > > 1 aaa
> > > > 2 bbb
> > > > 3 ccc
> > > >
> > > > When I delete the second record , I want it be adjust to be as
 following
> > > >
> > > > Seq value
> > > > -----------
> > > > 1 aaa
> > > > 2 ccc
> > > >
> > > > As you can see , the '3' has been changed to '2', The Seq had
 been
> > > > rearranged. I do not want to use trigger to achieve it.
> > > >
> > > > How can I do that? of course, one SQL is most approved.
> > > >
> > > > Thanks a lot
> > > >
> > > >
> > > >
> > > >
> > > > Sent via Deja.com http://www.deja.com/
> > > > Before you buy.
> > >
> > >
> >
> > In fact, it is a table to save temporary data. Every time insert a
> > record into it, set Seq = max(Seq)+1 . If I do not rearrange seq, it
> > will overflow.
> >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
> It does work. Thank you very much

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Fri Sep 08 2000 - 00:18:19 CDT

Original text of this message

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