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: sub-position counter

Re: sub-position counter

From: Carlos <miotromailcarlos_at_netscape.net>
Date: 15 Feb 2006 01:13:48 -0800
Message-ID: <1139994828.912919.237840@g43g2000cwa.googlegroups.com>


...and even better (for concurrency and serialization issues) could be using a sequence (absolute) instead of the TS column: something like:

sql> create table t1(id_n number not null, id_n_seq integer)

Tabla creada.

sql> create view t2(id_n, sub_id_n) as
  2 select id_n,
  3 row_number() over (partition by id_n order by id_n_seq) as sub_id_n
  4 from t1;

and provide a before insert trigger for filling in the :new.id_n_seq from a sequence.

HTH Cheers.

Carlos. Received on Wed Feb 15 2006 - 03:13:48 CST

Original text of this message

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