Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Autoincrement
Nothing is hard about it. I just don't wanna do it manually. We are
servleral persons that sometimes need to manually update the system as
it looks today and the 'my_seq' is often forgotten and when
setting 'not null' people started to inventing there own values rather
then finding out witch sequence to use. I'll don't want human to tusch
that column when inserting. In a simple free database mySQL there is a
function called autoincrement. I'd like something like that but don't
know how to do it in Oracle.
Tia
In article <7u4gc8$ttg$1_at_duke.telepac.pt>,
"Luis Campos" <lcampos_at_cpcis.pt> wrote:
> Create sequence my_seq
> start with 1
> increment by 1;
>
> insert into table (id, descr)
> values (my_seq.NEXTVAL, 'My Description');
>
> What is it hard about this?
>
> buurd_at_my-deja.com wrote in message <7u48nb$a5r$1_at_nnrp1.deja.com>...
> >Hi!
> >I'm looking for a function in Oracle that would autoincrement an
> >idcolumn so that every column gets it's own uniqe number. I'll looked
> >at seqences but i don't understand how to automate the process so
that
> >for every new row there is a new (uniqe) number.
> >
> >Tia
> >
> >--
> >Roland Carlsson
> >Certified Java programmer
> >Skövde
> >Sweden
> >
> >
> >Sent via Deja.com http://www.deja.com/
> >Before you buy.
>
>
--
Roland Carlsson
Certified Java programmer
Skövde
Sweden
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Thu Oct 14 1999 - 08:17:59 CDT