Resumen
The Describe function returns the properties described below for a workspace.
For a workspace, the Describe dataType property returns a value of "Workspace".
Propiedades
Propiedad | Explicación | Tipo de datos | ||||||||
connectionProperties (Sólo lectura) | connectionProperties is a property set. The connection properties for an enterprise geodatabase workspace will vary depending on the type of enterprise database being used. Possible properties include the following:
Only one historical_name, historical_timestamp, version, or branch value exists for any given workspace. | Object | ||||||||
connectionString (Sólo lectura) | The connection string that is used in conjunction with the enterprise database type. For any other workspace type, an empty string is returned. | String | ||||||||
currentRelease (Sólo lectura) | For a geodatabase workspace, specifies whether the geodatabase's version is current. This property can be used to assess whether the geodatabase can be upgraded. | Boolean | ||||||||
domains (Sólo lectura) | A list containing the geodatabase domain names. To work with these domain names, you can use tools in the Domains toolset. | String | ||||||||
release (Sólo lectura) | For a geodatabase workspace, returns the geodatabase release value. The following table shows the mapping of geodatabase release values to ArcGIS version numbers:
| String | ||||||||
supportsBigInteger (Sólo lectura) | Specifies whether the workspace supports Big Integer type fields. | Boolean | ||||||||
supportsBigObjectID (Sólo lectura) | Specifies whether the workspace supports objects with 64-bit Object ID. | Boolean | ||||||||
supportsDateOnly (Sólo lectura) | Specifies whether the workspace supports fields of type Date Only. | Boolean | ||||||||
supportsTimeOnly (Sólo lectura) | Specifies whether the workspace supports fields of type Time Only. | Boolean | ||||||||
supportsTimestampOffset (Sólo lectura) | Specifies whether the workspace supports fields of type Timestamp Offset. | Boolean | ||||||||
workspaceFactoryProgID (Sólo lectura) | The ID is a string that you can use to distinguish between workspace types with a finer granularity than you can with workspaceType. The following are workspaceFactoryProgID values returned for common workspace types:
Nota:Prior to ArcGIS Pro 3.0, a memory workspace would return a value of esriDataSourcesGDB.ColumnaDBWorkspaceFactory.1. Sugerencia:The .1 following the string returned by workspaceFactoryProgID is only present in 64-bit products. If writing code that will be used with 32-bit and 64-bit products, use the startswith string method.
| String | ||||||||
workspaceType (Sólo lectura) | Specifies the workspace type.
| String |
Muestra de código
The following stand-alone script displays some workspace properties for an enterprise database:
import arcpy
# Create a Describe object for an SDE database
#
desc = arcpy.Describe(r"C:data\Connection to state.sde")
# Print workspace properties
#
print("%-24s %s" % ("Connection String:", desc.connectionString))
print("%-24s %s" % ("WorkspaceFactoryProgID:", desc.workspaceFactoryProgID))
print("%-24s %s" % ("Workspace Type:", desc.workspaceType))
# Print Connection properties
#
cp = desc.connectionProperties
print("\nDatabase Connection Properties:")
print("%-12s %s" % (" Server:", cp.server))
print("%-12s %s" % (" Instance:", cp.instance))
print("%-12s %s" % (" Database:", cp.database))
print("%-12s %s" % (" User:", cp.user))
print("%-12s %s" % (" Version:", cp.version))
# Print workspace domain names"
#
domains = desc.domains
print("\nDomains:")
for domain in domains:
print("\t" + domain)