Select to view content in your preferred language

Truncate Table geoprocessing tool (arcpy) not work with AttributRule?

1208
4
Jump to solution
10-31-2023 04:25 PM
TTtttTeee
New Contributor III

Hi, I have come across an issue with the "Truncate Table" geoprocessing tool (arcpy as well).

The error, "Truncation not allowed while editing" came up when I run the tool for a feature class in our organization's enterprise environment. Certainly, I was not activating Edit when the tool gave me the error as per pic below. I have also tried "Append" tool on the same data, and this tool worked fine.

After some investigations, I have found a possible cause for this error, which may be an AttributeRule. I configured the AttributeRule on a data, and it works totally fine to edit features (add, update, and delete manually as well as Append tool) on this data. What I have found is if AttributeRule is enabled on this data, Truncate Table tool returns the error whereas if AttributeRule is disabled on this data, Truncate Table works as expected.

Is this a bug in the Truncate table tool? Or is there any workaround?

Thanks in advance for your advice.

TTtttTeee_0-1698794075300.png

 

0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

Did you try Delete Rows (alternate in some situations, to Truncate Table)

Delete Rows (Data Management)—ArcGIS Pro | Documentation


... sort of retired...

View solution in original post

4 Replies
DanPatterson
MVP Esteemed Contributor

Did you try Delete Rows (alternate in some situations, to Truncate Table)

Delete Rows (Data Management)—ArcGIS Pro | Documentation


... sort of retired...
TTtttTeee
New Contributor III

Thank you very much Dan!

I totally forgot the DeleteRows. This does not have any compatibility issue with AttributeRules configuration. Nonetheless, if the error returned by Truncatge Table is a bug, I would like ESRI to fix that up soon in the future.

0 Kudos
ZachBodenner
MVP Regular Contributor

I've spoken with ESRI about this very topic actually. The finding is indeed a bug:, 

The Truncate Table tool fails when the dataset participates in a composite relationship class and in an enterprise geodatabase.

In my case, that turns out to be when attachment tables exist. I had never intentionally made a composite relationship class, but that's what "enable attachments" does automatically. Does that sound like your scenario?

 

0 Kudos
TTtttTeee
New Contributor III

Hi @ZachBodenner , thanks for your attention on this issue.

Thats very good to know that you already reported this issue. 

My case is different from yours. This issue happens only when the AttributeRule is enabled. My AttributeRule establishes some relationships within the rule to achieve what I want. 

0 Kudos