Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to identify the best way to automatically maintain a unique id column in Oracle ArcSDE. I don't want to use a class extension, since I've multiple third party users of the data and it's too much of a headache. I thought I was being clever by editing the insert trigger created by the creation of a multiversion view for the feature class.

I created a sequence in Oracle, and then tried to use sequenceName.NEXTVAL to insert that into the appropriate column. The trigger compiles fine, and I can edit the feature class and insert new features just fine, but my sequence value is not getting inserted into the row. For example, I wrote

addNextVal := address_seq.nextval;
INSERT INTO SDE.A746 VALUES (next_rowid, addNextVal,:new.SUITE, ...

but it didn't work.

Any thoughts on the approach, and what I might do to solve this problem?

share|improve this question

You put sequence value into :new.address_id (use the correct column name instead of address_id) and let the insert command do its work:

create trigger A746_insert_trigger
before insert on SDE.A746
for each row
    select address_seq.nextval into :new.address_id from dual;

Comment: your code is not complete so maybe you need something different.

Example1, Example2

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.