Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: create table option
Regarding the primary key syntax:
create table T (a int primary key, b char(10))
Regarding the auto-increment: as quoted from a previous post by Thomas Kyte:
create sequence myseq;
create trigger my_trigger
before insert on T for each row
begin
if ( :new.column_to_fill_in is null ) then
select myseq.nextval into :new.column_to_fill_in from DUAL; end if;
end;
/
Laurent de Lasteyrie <lasteyrie_at_iname.com> wrote in message
news:3986c728.80973513_at_news.issy.cnet.fr...
> I have a table with a number that must inscrease automaticaly
> (it's a code) and must be a primary key, i've tried to do :
>
> Create Table Edit
> (CE Counter CONSTRAINT PrimaryKey PRIMARY Key,Nom_ Char(20));
>
> That work in other language but not in oracle. does anyone can
> help me telling me how to do the same in Oracle.
>
> Thank's in advance.
>
> --
> Laurent de Lasteyrie
> lasteyrie_at_iname.com
Received on Tue Aug 01 2000 - 00:00:00 CDT
![]() |
![]() |