Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: auto increment? 'enum' data type?
I just had a detailed answer to a similar question.
My SQL PlusPlus (freeware) generated all the code required for both of above.
BLDSEQ command will generate code to create sequence and the required pre-insert trigger.
BLDCON command generates an example of CHECK constraint which you can modify to suit your requirement.
regards,
M. Armaghan Saqib
in article <86lv65$jfu$1_at_nnrp1.deja.com>,
Otis Gospodnetic <otis_at_my-deja.com> wrote:
> 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 Wed Jan 26 2000 - 02:03:42 CST
![]() |
![]() |