Re: Automatic Numbers with Sequence

From: Gary Kirsh <gkirsh_at_news.dorsai.org>
Date: 1995/11/09
Message-ID: <DHrB1v.62J_at_dorsai.org>#1/1


Hauke,

Just use NEXTVAL like any other SQL operator, eg-

   field1 POSITION(1:8) CHAR "foo.NEXTVAL"

where "foo" is your sequence. This works like a charm, IF you put the following at the top of the control file (or on the command line):

   ROWS=1 This will commit on every row, which REALLY slows things down, but is necessary to get a new sequence number for each row. Hope your data file isn't too big...

Gary

--
Gary Kirsh
Next Extent, Inc.
Phone: (718) 380-8546
Internet: gkirsh_at_dorsai.org


lfeges_at_lfeges.tor.hookup.net wrote:


: In article <43b8ub$7mk_at_ns.access.ch>, <integrata_at_access.ch> writes:
: > Path:
: noc.tor.hookup.net!hookup!usenet.eel.ufl.edu!newsfeed.internetmci.com!howland.r
: eston.ans.net!EU.net!Germany.EU.net!news.dfn.de!scsing.switch.ch!ns.access.ch!i
: ntegrata
: > From: integrata_at_access.ch (INTEGRATA AG)
: > Newsgroups: comp.databases.oracle
: > Subject: Automatic Numbers with Sequence
: > Date: 15 Sep 1995 07:11:07 GMT
: > Organization: INTEGRATA AG
: > Lines: 9
: > Message-ID: <43b8ub$7mk_at_ns.access.ch>
: > NNTP-Posting-Host: integrata.access.ch
: > X-Newsreader: News Xpress Version 1.0 Beta #3
: >
: > Hi there,
: > i am looking for a nice way to implement automatic numbering (keys)
: > within an oracle database.
: > all i could find up to now, is using a sequence and a trigger,
: > that always selects the next key from a dummy table before an insert.
: > is this the only (and/or) best way to do it ????
: >
: > Hauke
: >

: Yes, this is the best way because Oracle will coordinate the conflicts when
: more then one request is made for the next sequential number.

: \lfeges
Received on Thu Nov 09 1995 - 00:00:00 CET

Original text of this message