Select to view content in your preferred language

Arcade expression Sequence value generation Issue

139
4
Jump to solution
Thursday
JayaramBT
Emerging Contributor
Error details: ERROR 002904: Sequence does not exist.
[Rule Name: "SL-Unique Name/ID Generation",
Sequence Name: "DUCTAUTONUMBERING"]
 
I have create the sequence first in PostgreSQL database and granted the select, update and delete permission to the sequence and later we developed arcade code. the rule was a constraint rule that rule need to trigger on insert and update events. please find the code below ways I tried. same schema i create connection file but I am not able to find the root cause. can you please help me.
 
Type:1
var cat = DefaultValue($feature.NE_CATEGORY_NAME, "");
var type = DefaultValue($feature.NE_TYPE_NAME, "");
if (cat != "OSP") { return null; }
var valid = Decode(type, "TRENCH", 1, "CONDUIT", 1, "POWER", 1, 0);
if (valid == 0) { return null; }
var nextVal = NextSequenceValue('DUCTAUTONUMBERING');
return Text(nextVal);
 
Type2:
var nextVal = NextSequenceValue('unm_owner.DUCTAUTONUMBERING')

Type3:
var nextVal = NextSequenceValue('unm_owner.DUCTAUTONUMBERING');
0 Kudos
1 Solution

Accepted Solutions
RobertKrisher
Esri Regular Contributor

Does it work if you use the CreateDatabaseSequence tool to create the sequence as the data owner?

View solution in original post

0 Kudos
4 Replies
RobertKrisher
Esri Regular Contributor

Does it work if you use the CreateDatabaseSequence tool to create the sequence as the data owner?

0 Kudos
JayaramBT
Emerging Contributor

Hi Robert,

I need some additional information regarding cross-schema access in PostgreSQL and ArcGIS Pro.

In our PostgreSQL database, we have multiple schemas created for project-related custom tables. For example:

  • ROSE schema contains custom lookup/reference tables.
  • UNM_OWNER schema contains the Utility Network feature classes.

My requirement is that when a feature is created or updated in ArcGIS Pro, an Arcade attribute rule should execute, retrieve information from a table in the ROSE schema, and then populate attributes in a feature class stored in the UNM_OWNER schema.

I developed a sample Arcade expression to test access to a table in the ROSE schema, but the table is not being accessed successfully. I have already granted the necessary permissions in PostgreSQL, including schema and table-level access.

Could you please let me know if there are any limitations or additional configuration requirements for accessing tables across different PostgreSQL schemas from Arcade attribute rules in ArcGIS Pro.

Any guidance on the root cause or recommended approach would be greatly appreciated.

 

var assocTable = FeatureSetByName(
$datastore,
"ni_20exdataun.Rose.bt_naming_sequences"
);
return Count(assocTable);

0 Kudos
RobertKrisher
Esri Regular Contributor

The recommended way to use sequences is to use the CreateDatabaseSequence tool to create managed sequences for all the different sequences you need to be used by the attribute rule using the data owner that will need access to these sequences. You can then reference that sequence in an attribute rule's run by that database user. You can find an example in this KB article: Add Auto Sequential Values Using Attribute Rules in ArcGIS Pro.

If you haven't already, please log a case with support to review the error you are receiving along with ensuring that everything is configured correctly.

0 Kudos
RobertKrisher
Esri Regular Contributor

@JayaramBT are the tables you're trying to access registered with the geodatabase?

0 Kudos