Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Autoincrement in Oracle
You'll need to use a sequence for this purpose. A sequence is not bound to a
column however. It also does not reindex. If you delete something you will
have a 'hole'.
A description for this is not in a faq but in the f... manual, Oracle SQL
reference. If you don't have it, *all* manuals are online at
http://technet.oracle.com
Of course taking the max(id) would be a perfectly valid solution.
Hth,
Sybrand Bakker, Oracle DBA
"Florian Leibenzeder" <flo_at_linx.net> wrote in message
news:3944CB31.5901C2EA_at_linx.net...
> Hi,
>
> I am new to oracle and this is probably a faq question so if it is
> could somebody just post a link to the faq.
> Otherwise: Is there a way in Oracle8i to have a column which
> autoincrements whenever you add a new row. (Does it reindex when you
> remove something?)
> I just can't imagine that you have to check for the max(id) and
> increment that before adding a new row :-)
>
> Thanks for any help
>
> Florian
Received on Mon Jun 12 2000 - 00:00:00 CDT