Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: ORACLE8: Automatic Counter Problem
In article <Pine.GSO.4.10.9904141659210.24128-100000_at_ogre.rby.hk-r.se>,
Magnus Lindhe <pt96mli_at_student.hk-r.se> wrote:
> Is it possible to have some kind of automatic counter data type in Oracle
> 8? If not, how can the same behaviour be solved by the developer?
>
> /magnus
>
It sounds like you are asking about a sequence generator which is used to create a numeric sequence of values that are often used as a key. See the CREATE SEQUENCE command in the SQL Manual and you can look up using sequences in the Concepts manual and/or the DBA Admin. Guide.
Basically you can:
create sequence sequence_name;
insert into my_table (key, other_col)
values ( sequence_name.nextval,'other_col_value');
--
Mark D. Powell -- The only advice that counts is the advice that
you follow so follow your own advice --
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Wed Apr 14 1999 - 14:29:48 CDT