Is it possible to get an attribute rule to fire sequentially as records are appended to a feature class?
As a test I set a geodatabase sequence in a file geodatabase with a start value of 100 and increment value of 1. I then added a standard return NextSequenceValue rule to a field, UniqueID:
return "Prefix-" + NextSequenceValue ("SequenceName")
Then I appended several hundred records from another feature class. All of the appended records have a UniqueID value of Prefix-100.
I was hoping they would have Prefix-100, Prefix-101, Prefix-102 and so on.
Is there a way to write a rule that uses a database sequence and will assign incremental values with a multi-record append?
For now I've created a python script tool that uses a search cursor and a select statement within the search cursor to select a single feature in the input feature class and append it to target feature class.
It works, but anytime you have a search cursor with a selection, it's not the fastest thing around; to work through 100 records in the input feature class, it takes about 2.5 minutes to complete; however, since it's appending one record at a time, the sequence based attribute rule fires and updates the field accordingly.
Hi @JoeBorgione ,
The NextSequenceValue should generate a new value every time a value is inserted in your data. How did you configure the sequence?
The functionality that you are looking for is the one you are using, but it is strange that the same value is generated for each new feature (I don't think an append would be a single action and triggering the attribute rule only once...)
Happy New Year @XanderBakker . I set the sequence up just like any other I've used with a start value and an increment value. It thought an append would fire the rule as each record is appended, not as a single update. The cursor/select method works, so we are good to go. I was just thinking if there might be a better way...
Hi @JoeBorgione , happy New Year to you too.
I think the desired functionality of an attribute rule would be that it would be triggered by the newly appended features. Might be good to register this with support, since I don't think this is correct behavior.
Just did a quick test on 2.7 and seems to be working
created two point classes testfrom and test
created a bunch of features in testfrom
created a sequence + AR above on Test class
executed an append from testfrom-> test and the resulting AR got executed as expected.
I'll give it a second try then; maybe it's 2.6 thing. I'm late in updating...