Attribute Rules using NextSequenceValue

1265
2
02-22-2021 06:00 PM
Labels (1)
VishApte
Esri Contributor

Hi all,

I have a query regarding the Arcade function NextSequenceValue to assign as assetid attribute. Very similar to this link.

I have a multi-domain utility client that has Water, Sewer and Electric domains. Each domain classes reside in a separate SQL Server geodatabase. The client wants to use single sequence for all assets as these assets are linked to Asset Mgmt system. 

It seems that  NextSequenceValue function assumes the sequence must reside in a same geodatabase. Is there a way to use a sequence in one centralised database and make it available for NextSequenceValue? I tried creating SQL Alias for the sequence in each Water, Sewer and Electric database but that does not work. It is not supported by SQL Server to query next sequence number using SQL ALias.    

Any other solution? Client cannot combine Water, Sewer and Electric domains in a single geodatabase.

Thanks,

Vish

0 Kudos
2 Replies
JohannesLindner
MVP Frequent Contributor

You can specify the full name of the database sequence. If all databases are in the same datastore, this might work (can't test, since I have only one database):

NextSequenceValue("SequenceDatabaseName.SequenceOwner.SequenceName")

 

Alternatively, you could define a sequence called "AssetID" in all databases and append a domain name, so that all assets have a unique id:

// water database:
"Water-" + NextSequenceValue("AssetID")
// sewer database:
"Sewer-" + NextSequenceValue("AssetID")

// this gives you these asset ids:
// Water-1, Water-2, ..., Water-6379
// Sewer-1, Sewer-2, ..., Sewer-6379

Have a great day!
Johannes
0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi @VishApte ,

If the Utility Network is something the client is considering, all three domains could participate in the same Utility Network. There can be additional benefits when combining the Water and Electric domains in the same UN. When for instance a failure in the electric domain affects a water pump station and results in an outage of water.

As far as I can see the sequence should reside in the same geodatebase for the attribute rule to have access to it.

0 Kudos