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: Sequences?

Re: Sequences?

From: Jim Kennedy <kennedy-family_at_attbi.com>
Date: Thu, 14 Feb 2002 04:36:57 GMT
Message-ID: <J9Ha8.49707$fK1.4137541@rwcrnsc54>


It's magic.
Sequences are controlled by the database and doled out as you ask for them eg mysequence.nextval
Jim
"Bruce" <bghagy_at_attbi.com> wrote in message news:YZFa8.53731$Pz4.283117_at_rwcrnsc53...
> What's the mechanism to keep the value unique? If another SELECT is run
> before the first INSERT wouldn't that give you two equal values?
>
>
> "damorgan" <dan.morgan_at_ci.seattle.wa.us> wrote in message
> news:3C6A966C.5E02C7DF_at_ci.seattle.wa.us...
> > There is no relationship between MS Access's autonumbering and a
SEQUENCE.
> The
> > autonumering is part of the table and is only capable of sequential
> numbering.
> > It has no flexibility, no programmability, and is strictly tied to a
> single
> > table. All it is is the following code built in and hidden from the end
> user.
> >
> > SELECT MAX(numbering_field)
> > INTO next_number
> > FROM xyz;
> >
> > INSERT INTO xyz
> > (numbering_field + 1, other_field1, other_field2)
> > VALUES
> > (next_number, someval1, someval2);
> >
> > Daniel Morgan
> >
> >
> >
> > Magnus Ytterstad wrote:
> >
> > > Not sure how MS Access autonumber works, but it does sound like a
> sequence
> > > to me.
> > >
> > > To create a sequence use the following syntax
> > >
> > > CREATE SEQUENCE MYSEQUENCE INCREMENT BY 1 START WITH 1000;
> > >
> > > When you want to access the sequence and get the next number, you just
> issue
> > > the command MYSEQUENCE.NEXTVAL, i.e.:
> > >
> > > INSERT INTO MYTABLE (NAME, DEPT, ID)
> > > VALUES ('John', 'Sales', MYSEQUENCE.NEXTVAL);
> > >
> > > Hope this helps!
> > > -magnus.
> > >
> > > Bruce <bghagy_at_attbi.com> wrote in message
> > > news:gP3a8.39737$bh3.256829_at_rwcrnsc52.ops.asp.att.net...
> > > > How would one go about implementing the MS Access autonmuber data
type
> in
> > > > 8i? Are sequences the way to go and could you point me in the right
> > > > direction.
> > > >
> > > >
> >
>
>
Received on Wed Feb 13 2002 - 22:36:57 CST

Original text of this message

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