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 -> auto increment? 'enum' data type?

auto increment? 'enum' data type?

From: Otis Gospodnetic <otis_at_my-deja.com>
Date: Wed, 26 Jan 2000 05:03:03 GMT
Message-ID: <86lv65$jfu$1@nnrp1.deja.com>


Hi,

I'm new to Oracle and am wondering what's the best/easiest way to make a column 'auto increment' (e.g. an ID column used as a primary key)? Do I have to make a sequence in my schema for that particular column/table/database? Or can I specify something like 'AUTO INCREMENT' when I do CREATE TABLE .... (doesn't seem to be the case).

I am also wondering if there is a data type that will let me specify a list of all possible values that a column can have, so that no other value can be inserted in that column?
In MySQL I would do somehting like this, for example:

        gender enum('Male','Female')
How about under Oracle?

Thanks,

Otis
P.S.
I ordered an Oracle book, it's just hasn't been delivered yet...

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Jan 25 2000 - 23:03:03 CST

Original text of this message

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