Select to view content in your preferred language

Python or SQL for 'Version Changes'?

1784
10
Jump to solution
11-30-2023 02:58 PM
Labels (3)
FredSpataro
Frequent Contributor

Hi All, 

There's an ArcPro tool called 'Version Changes' on the Versioning ribbon (see picture below).  Is there a python/gp tool or SQL template to achieve the same thing?  

We need to implement some automated QA/QC and auditing tasks.  It would be 'waaaayyyy' better if we could grab this info without asking the user to press the button. 

 

Thanks

FredSpataro_0-1701384984312.png

 

0 Kudos
1 Solution

Accepted Solutions
MarceloMarques
Esri Regular Contributor

@FredSpataro - I agree that ArcGIS Pro "Version Changes" needs to be available as an arctoolbox geoprocessing tool and in arcpy for users, if you want to submit an enhancement request then please open an Esri Technical Support Case, I also suggest creating an ArcGIS Idea about the enhancement so other users can vote on the idea, that helps build the case for the enhancement request to get implemented in a future release of ArcGIS Pro.

| Marcelo Marques | Esri Principal Product Engineer | Cloud & Database Administrator | OCP - Oracle Database Certified Professional | "In 1992, I embarked on my journey with Esri Technology, and since 1997, I have been working with ArcSDE Geodatabases, right from its initial release. Over the past 32 years, my passion for GIS has only grown stronger." | “ I do not fear computers. I fear the lack of them." Isaac Isimov |

View solution in original post

0 Kudos
10 Replies
DanPatterson
MVP Esteemed Contributor

arcpy can access all arctoolbox tools such as those in

An overview of the Versions toolset—ArcGIS Pro | Documentation

or via arcpy directly if this is the versions you are referring to

https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/listversions.htm

Version—ArcGIS Pro | Documentation


... sort of retired...
0 Kudos
MarceloMarques
Esri Regular Contributor


ArcGIS Pro "Version Changes" is not exposed as a geoprocessing tool therefore it is also not exposed in arcpy. 

An overview of the Versions toolset—ArcGIS Pro | Documentation

An overview of ArcPy functions—ArcGIS Pro | Documentation

-------------------------------

But you can use ArcGIS Pro SDK for .NET.

ArcGIS Pro SDK | Documentation

FeatureClass Class—ArcGIS Pro  - Featureclass.Differences

Solved: Version Differences - Esri Community - this link has a code example.

-------------------------------

You could also use FME Workbench.

Extracting Differences from an ArcSDE Geodatabase (safe.com)

I am not sure if this is exposed in the ArcGIS Pro Data Interoperability Extension, but if it is then you could use an ArcGIS Pro Model Builder to call the ArcGIS Pro Data Interoperability Transformer.

-------------------------------

There in no way to see the version changes using SQL.

Edit versioned data in SQL Server using SQL—ArcMap | Documentation (arcgis.com)

-------------------------------

I hope this helps.

| Marcelo Marques | Esri Principal Product Engineer | Cloud & Database Administrator | OCP - Oracle Database Certified Professional | "In 1992, I embarked on my journey with Esri Technology, and since 1997, I have been working with ArcSDE Geodatabases, right from its initial release. Over the past 32 years, my passion for GIS has only grown stronger." | “ I do not fear computers. I fear the lack of them." Isaac Isimov |
0 Kudos
FredSpataro
Frequent Contributor

@MarceloMarques thanks... i knew it wasn't in the version toolbox (hoping it might be somewhere else hidden...) 

I'll look into the SDK, i have a vague recollection of doing something way back with the ArcObejcts SDK.  I profiled the database when the button was run, hoping for some SQL insight but it's really complicated.  We've got a start with some SQL comparing on the multiversion views ... just seems like that button would be useful from arcpy or sql... 

0 Kudos
Bud
by
Esteemed Contributor

Might be worthwhile to submit an idea/enhancement request?

0 Kudos
MarceloMarques
Esri Regular Contributor

@FredSpataro - I agree that ArcGIS Pro "Version Changes" needs to be available as an arctoolbox geoprocessing tool and in arcpy for users, if you want to submit an enhancement request then please open an Esri Technical Support Case, I also suggest creating an ArcGIS Idea about the enhancement so other users can vote on the idea, that helps build the case for the enhancement request to get implemented in a future release of ArcGIS Pro.

| Marcelo Marques | Esri Principal Product Engineer | Cloud & Database Administrator | OCP - Oracle Database Certified Professional | "In 1992, I embarked on my journey with Esri Technology, and since 1997, I have been working with ArcSDE Geodatabases, right from its initial release. Over the past 32 years, my passion for GIS has only grown stronger." | “ I do not fear computers. I fear the lack of them." Isaac Isimov |
0 Kudos
FredSpataro
Frequent Contributor
0 Kudos
MarceloMarques
Esri Regular Contributor

@FredSpataro - Thanks for creating the ArcGIS Idea, I have added a few comments to the idea to bring more clarification, I hope it helps.

| Marcelo Marques | Esri Principal Product Engineer | Cloud & Database Administrator | OCP - Oracle Database Certified Professional | "In 1992, I embarked on my journey with Esri Technology, and since 1997, I have been working with ArcSDE Geodatabases, right from its initial release. Over the past 32 years, my passion for GIS has only grown stronger." | “ I do not fear computers. I fear the lack of them." Isaac Isimov |
0 Kudos
Bud
by
Esteemed Contributor
  1. Could you query the ADDS and DELETES tables, in conjunction with the default version, using SQL to get the information you need?
  2. When clicking that button in the UI, what SQL query does Pro send to the database? Can you look at the SQL logs in the Diagnostic monitor? Or get your DBA to do a SQL trace?
  3. Can you show us more examples of what you want?
  4. Could you mock up something in Excel to show us what the data/result would look like?
0 Kudos
MarceloMarques
Esri Regular Contributor

@Bud - The SQL Queries in a traditional versioned and branch versioned geodatabase are very complex SQL Queries, that includes the state lineage number, among many other parameters and values.

If you run a database trace to capture the SQL Queries you will see that the logic is not easy to reproduce, hence making it impossible to manually create SQL Queries to fetch the Geodatabase "Version Changes".

I agree that the ability to use SQL Queries to fetch the Geodatabase "Version Changes" would be a nice enhancement.

@FredSpataro  wrote above

"I profiled the database when the button was run, hoping for some SQL insight but it's really complicated.  We've got a start with some SQL comparing on the multiversion views ... just seems like that button would be useful from arcpy or sql... "

| Marcelo Marques | Esri Principal Product Engineer | Cloud & Database Administrator | OCP - Oracle Database Certified Professional | "In 1992, I embarked on my journey with Esri Technology, and since 1997, I have been working with ArcSDE Geodatabases, right from its initial release. Over the past 32 years, my passion for GIS has only grown stronger." | “ I do not fear computers. I fear the lack of them." Isaac Isimov |
0 Kudos