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

Home -> Community -> Usenet -> c.d.o.server -> Re: bind sequences to columns

Re: bind sequences to columns

From: Paul Brewer <paul_at_paul.brewers.org.uk>
Date: Fri, 18 Oct 2002 21:16:50 +0100
Message-ID: <3db076d0_2@mk-nntp-1.news.uk.worldonline.com>


"Jusung Yang" <JusungYang_at_yahoo.com> wrote in message news:130ba93a.0210161040.398838ff_at_posting.google.com...
> Yes, it would be nice to have something like that. But
> sequence.nextval can only be used within a SQL statement and I don't
> think you can put a SQL behind the default clause of a table. I tried
> to find a more elegant solution to convert SQL server identity column
> to no avail. The application we converted from SQL server ended up
> with a bunch of sequences and triggers. Not difficult, but I would
> rather not see them. It was 8i. I don't think it is any differnet with
> 9i, since I noticed the 9i version of Migration Work Bench still uses
> the same approach to convert identity column.
>
>
> - Jusung Yang
>
>
> Hans Erik Busk <tbf_at_cn.stam.dk> wrote in message
news:<j4lqqu414brmgtcl4hctv29vojuqlg09g5_at_4ax.com>...
> > On 14 Oct 2002 12:27:53 -0700, JusungYang_at_yahoo.com (Jusung Yang)
> > wrote:
> >
> > >Maybe you are looking for something like the "identity" functionality
> > >in SQL server, where the value of a column is automatically
> > >incremented when a new row is inserted? You will have to use trigger
> > >and sequence for that with ORACLE.
> > >
> > >
> > >- Jusung Yang
> > >
> > >
> > >thomas.hiller_at_warema.de (Thomas) wrote in message
news:<6e366956.0210140406.797e4d4c_at_posting.google.com>...
> > >> Hi *,
> > >>
> > >> is there any possibility to bind a sequence to a specific column of a
> > >> table. I know that Oracle 7.3 does not provide any function like
that,
> > >> but how about Oracle 9i (9.2)
> > >>
> > >> regard
> > >> thomas
> >
> > It would be nice if a column could have a sequence.next_val as the
> > default value.
> >
> > Hans Erik Busk
> > tbf_at_cn.stam.dk

And I think it would be a good idea to consider whether surrogate keys are really necessary in the first place. Sometimes they are, sometimes not. But IMHO we should always check to see whether a natural key is available. My 2c.

Paul Received on Fri Oct 18 2002 - 15:16:50 CDT

Original text of this message

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