Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: ID/Counter datatype.

Re: ID/Counter datatype.

From: Christian Kaas <c.kaas_at_odn.de>
Date: 1997/08/15
Message-ID: <33f581bd.690998@news.nuernberg.odn.de>#1/1

Use a SEQUENCE for every single table and write a on insert trigger like this
create sequence seq_yourtable start with 1;

create or replace trg_yourtable_bu
before insert on yourtable
for each row
is
begin

        select seq_yourtable.nextval into :new.yourtable_counterfield; end;

On Tue, 05 Aug 1997 20:23:28 -0500, Guang Yang <sunlight_at_iastate.edu> wrote:

>Does anyone happen to know whether Oracle provides the similar datatype
>as identifier/counter in SQL-server/Access, which could be incremented
>by system automatically without using SQL to fill in that field. If that
>datatype is not available in Oracle, is there a way to create another
>approach to inplement similiar type, such as a view?
>
>Any idea will be great appreciated.
>
>Guang.

Christian Kaas
Client/Server development and consulting Fax. 49-9129-5518
Phone 49-9129-5508 Received on Fri Aug 15 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US