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 at Oracle

Re: Sequences at Oracle

From: Uwe Schneider <uwe_at_richard-schneider.de>
Date: Thu, 25 Oct 2001 21:41:30 +0200
Message-ID: <3BD86AEA.418E1D96@richard-schneider.de>


Yaron Avior wrote:
>
> Hi,
> In SQL-Server, when you enter a new record to a table with an
> identity, this column's value is inserted automaticly after the last
> value is incremented.
> is it the same at Oracle (if I have a sequence) or I need to increment
> the sequence myself?
> can someone bring an example???
>

A typical statement looks like:

INSERT INTO foo (id, a, b) VALUES (seq_foo.nextval, :a, :b)

with seq_foo as the name of a sequence for IDs of foo: CREATE SEQUENCE seq_foo

Uwe

-- 
Uwe Schneider       | Telefon +49 7244 / 609504
Karlsdorfer Str. 31 | Mail    uwe_at_richard-schneider.de
DE-76356 Weingarten | http://www.richard-schneider.de/uwe
Linux - OS al dente!
Received on Thu Oct 25 2001 - 14:41:30 CDT

Original text of this message

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