AnsweredAssumed Answered

Cannot add coded values to Domains for SDE Enterprise Geodatabase using .py Example

Question asked by NEOMAPPER on Sep 27, 2017

I'm trying to add coded values to a new created domain using Arcpy in ArcCatalog but I keep getting this strange error. The domain gets created but the coded values generate an error. I used this exact python tool for a local file geodatabase with no issues so I don't understand why there would be problems with an enterprised geodatabase.

 

Software:

ArcGIS Desktop version: 10.3.1

Enterprise Geodatabase version: 10.3.1

SQL 2012

 

Code: 

import arcpy
from arcpy import env

domName = "test"
gdb = "GIS.sde"

env.workspace = "C:\Users\jnmiller\AppData\Roaming\ESRI\Desktop10.3\ArcCatalog"
arcpy.CreateDomain_management(gdb, domName, "Test Materials", "TEXT", "CODED")

domDict = {"CI":"Cast iron", "DI": "Ductile iron", "PVC": "PVC", \

                         "ACP": "Asbestos concrete", "COP": "Copper"}

for code in domDict:
            arcpy.AddCodedValueToDomain_management(gdb, domName, code, domDict[code])

 

Error: Why does this list every single domain already created in the database?

Runtime error Traceback (most recent call last): File "<string>", line 10, in <module> File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\management.py", line 1317, in AddCodedValueToDomain raise e ExecuteError: ERROR 000800: The value is not a member of Gas Service Diameter Plastic PVC | Rectifier Manufacturer | Work Order Status | GasASTMF2897CSteelPipeType | Pipe Diameter Plastic PVC | Leak Survey Frequency | ILI Survey Ext Indicator | Pipe Crossing Piped Utility | Gas Service Diameter Plastic PE | Pass Fail | YesNo Indicator with NA | CompanyID | Length Source | HCA Area Class | Pipe Diameter Units | Regulator Casing Material | UnitsForPressure | Leak Cause Material | ExcavDam Damage Type | HCAProvenance | PipelineMarker Condition | ExcavDam Work Type | Pipe Non-Steel Seam Type | Coating Condition | Regulator Body Types | GASASTMF2897Regulator | GasASTMF2897EFV | Item Number Pipe | ControllineManufacturer | GasASTMF2897ComponentMaterial | Method Detected Type | Compressor Station Type | Yes No Indicator | Gas Pipe Diameter Cast Iron | GasASTMF2897PlasticPipeType | Pipe Diameter | Odorizer Manufacturer | Gas Flow | Anomaly Remediation | Soil Type | System Names | Coating Type | PipeGrade | Rectifier Type | Rectifier Cable Gauge | Leak Location | Gas Service Diameter Plastic ABS | Leak Cause | Leak Class | Valve Use Type | GasASTMF2897CouplingType | Pipe Casing Protection Type | Could Affect Intersection Type | Dehydration Method | Pilot Connect Type | Meter Manufacturers | Valve Model | Gas Pipe Manufacturer | Pipe_WallthicknessSteel | Pipe Casing End Connection | Regulator Type | Test Point Type | On Off Status | Pipe Metallic Seam Type | Gas Pipe Diameter Copper | Pipe Facility Status | Wellhead Material Class | Gas Pipe Diameter Plastic ABS | Regulator Manufacturer | Gas Pipe Diameter Wrought Iron | GasASTMF2897Anodes | Leak Survey Work Order Type | Leak Survey Type | GasASTMF2897Elbows | Gas Pipe Diameter Ductile Iron | Pipe Casing Reason | Surface Type | Leak Cause Corrosion | Leak Facility Type | Leak Closed Status | Meter Type | Leak Method Detected Type | Marker Type | ExcavDam Root Cause | Item Number EFV | PipeWallThickness | Pipe Type | Gas Service Diameter Coated Steel | Operating Status | GasASTMF2897_Manufacturer | Anomaly Priority | Fitting Manufacturer | Document Maturity Index | Anomaly Type | GasASTMF2897SteelPipeMaterial | Inspection Range Type | Item Number Shortstop | Valve Material | Valve Type | DocumentType | GasASTMF2897CompositePipeMaterial | PipePressureRating | GasASTMF2897Transitions | Operating Classification | Gas Pipe Diameter Units | Leak Repair Type | Consequence Area Type | CP System Protection Type | Gas Pipe Diameter Plastic | Station Pipe Diameter | Pipe Casing Diameter | Pipe Fitting Material | Leak Inspect GasIn | AnnotationStatus | ILI Survey Marker Type | EFV Diameter | Gas Service Diameter Bare Steel | Gas Pipe Diameter Bare Steel | PipeMaterial | Gas Service Diameter Cast Iron | Pipe Casing Fill Type | Gas Service Diameter Plastic Other | Valve Position | GasASTMF2897Valve | Pipe Crossing Topographic | Structures Limited Mobility Reason | Leak Work Performed | Wellhead Diameter | Anomaly Severity | Time Classification | dLRSNetworks | GasASTMF2897Tees | ILI Survey Type | Corrosion Condition | Vault Material | Spatial Accuracy | Could Affect Type | Wellhead Connection type | ValueMethod | Fitting Style | PipeTestType | Product Commodity Type | Pipe Connection Type | UnitsForDiameter | Item Number Meter | HS LS | Line Valve Connection Type | Structure Types | GasASTMF2897IronPipeMaterial | GasASTMF2897CopperPipeMaterial | dActivityType | Strainer Device Type | DA Survey Type | Valve Diameter | Pipe Install Method | Alignment Sheet Type | Leak Cause Excavation | Pipe Outside Diameter Coated Steel | Pressure Test Type | Odorizer Size | Gas Pipe Diameter Composite | CP System Status | Pressure Monitor Device Manufacturer | CP Color Code | Strainer Manufacturer | HCA Area Type | StrainerModel | Anode Weight | Pipe Fitting Diameter | Pipe Crossing Wired Utility | DOTClassType | Pipe Outside Diameter Bare Steel | Leak Survey Method | ControlLineModel | Material4 | GasASTMF2897Strainers | Wellhead Pressure Rating | Recording Method | Anode Material Type | CP Bond Junction Type | Wellhead Type | PipeEditResponse | Gas Service Diameter Wrought Iron | Anomaly Status | Gas Service Diameter Ductile Iron | GasASTMF2897PlasticPipeMaterial | EnabledDomain | Test Point Num Wires | Pipe System Type | GasASTMF2897EndCap | VerticalAlignment | InspRemediation | Gas Service Diameter Copper | UnitsForLength | BooleanDomain | Pressure Test Medium | PipeManufacturer | DOTClassSource | Identified Site Outside Area | Pressure Established By | InspectionNote_Type | Company ID | IdentifiedIssue | PipeCondition | States | Corrosion Extent | Pipe Crossing Location | Operating Type | GasASTMF2897BSteelPipeType | ExcavDam Resp Party Type | Gas Pipe Diameter Coated Steel | ExcavDam Equip Cause Damage | Present Status | PipelineMarker | Over Pressure Protection Type | Pipe Crossing Transportation | Pipeline Operator | AncillaryRoleDomain | BooleanSymbolValue | System Numbers | Object Status | GasASTMF2897Reducers | Pipe Material | Valve Manufacturer | Leak Force NatForce.
>>>

Attachments

Outcomes