Can we use oracle sequencers to autoincrease a filed in a feature class

2159
1
07-17-2010 05:27 AM
JoseSanchez
Occasional Contributor III
Hi all

This is a question about a field that must be auto incremented in a feature class. The feature class belongs to a geodatabase based in ArcSDE and Oracle 10G.

I would like to know if an Oracle Sequence can be used in a feature class when edited to have the field populated by a trigger.

I saw this example and wanted to know if I can implement it:

Example Number 2 ...

How to create an autoincrement field in a table with a sequence ...

SQLWKS> create table bob(a number , b varchar2(21));
Statement processed.

First create a sequence
SQLWKS> create sequence x ;
Statement processed.

Then create the trigger.
create trigger y before insert on bob
for each row
when (new.a is null)
begin
select x.nextval into :new.a from dual;
end;
/

http://www.databaseanswers.org/sql_scripts/ora_sequence.htm
0 Kudos
1 Reply
VinceAngelo
Esri Esteemed Contributor
There isn't much of an issue using this for a simple feature class, but if you use versioning
or complex behaviors in feature datasets you may run in issues.  ArcSDE used to use simple
sequences, but the performance was sufficiently slow with bulk loading that the current
"sequence and pipe" mechanism replaced it.

- V
0 Kudos