Re: Sequences
Date: 1996/08/06
Message-ID: <32077CA4.58BA_at_us0n05.glaxo.com>#1/1
Kolbjørn Aambø wrote:
>
> In article <32040DCF.539D_at_well.com>, Michael Wilson <mkwilson_at_well.com> wrote:
>
> > I have a couple of questions about sequences:
> >
> > 1. Just how lightweight are sequences? From what I've read, they seem to
> > provide a unique # for any number of requestors, without all the muss
> > and fuss of creating a counter in a row, and going through the overhead
> > of locking, etc; to maintain it. Right?
> >
> > 2. How many sequences can I have? We have an application which
> > potentially require thousands of individual sequences, but's it's
> > unclear how much overhead each one takes. From my reading, it looks like
> > sequences are stored in the data dictionary, but does each one consist
> > merely of a row?
> >
> > Thanks in advance..
>
> If I define the following in PL/SQL:
>
> CREATE SEQUENCE sq START WITH 13 INCREMENT BY 1;
>
> I want to do do the following in PL/SQL but are not able to:
>
> CREATE OR REPLACE FUNCTION SA RETURN NUMBER IS
> id NUMBER;
> BEGIN
> RETURN sq.NEXTVAL;
> END SA;
>
> What am I doing wrong?easy, just set up a temp variable in your proc and select the
sq.nextval into that variable and then return it.
Received on Tue Aug 06 1996 - 00:00:00 CEST