Zusammenfassung
Lists the versions the connected user has permission to use.
Auswertung
You can specify the path to a connection file as an argument to the function or you can set the workspace environment to the connection file and call the ListVersions function without any arguments. Only those versions the connected user has permissions to use will be included in the list returned by the function.
Syntax
ListVersions (sde_workspace)
Parameter | Erklärung | Datentyp |
sde_workspace | An enterprise geodatabase workspace. | String |
Rückgabewert
Datentyp | Erklärung |
String | The string returned from the function containing version names in the enterprise geodatabase the connected user has permissions to use. |
Codebeispiel
ListVersions example
Gets the list of versions the user has permissions to use and prints them.
import arcpy
database = "Database Connections/toolboxDEFAULTVersion.sde"
versions = arcpy.ListVersions(database)
# Print the versions available to the user
for version in versions:
print(version)