2

For an Enterprise GeoDatabase, I'd like to restrict the values of a feature class' field to a range of values. Essentially, I want validation at the database level, so that regardless of how the data is being inserted, the constraints are persisted (e.g. ArcGIS for Server feature service, ArcPy, ArcMap, ArcObjects, etc.). I tested domains, however I noticed that from the feature server service endpoint I can insert a value outside of my specified range.

For example, if I specify a range to 0 to 1, I can set the field to 6 from the service endpoint and it will be inserted into the GeoDatabase successfully.

I think database triggers or possibly creating a server object extension may be the only option.

  • There are triggers on the database side and also events on the ArcGis side.. perhaps it would be better to send the user a message 'hey, don't put "6" in this field as it's only supposed to have 0..1', to do that though would need some ArcObjects.. is that an option for you? – Michael Stimson Apr 29 '15 at 1:12
  • From the web application point of view, I will also use client-side validation for the user's convenience. However, I don't trust that all applications will use these rules, so I would want server itself to provide validation as well. – hedz09 Apr 29 '15 at 1:21
  • What is the underlying database? I know with SQL Server (Enterprise) and PostgreSQL you can certainly create triggers that fire on the new row or on update that return the modified (or new) rows which you can test and then reject if you wish... that can however cause angst if the user is not made aware, all they see is the feature reverting to what it was before it was saved or vanishes in the case of a new feature, followed shortly by a terse phone call to I.T. support. – Michael Stimson Apr 29 '15 at 1:59
  • Oracle. I'm wondering if the user adds a feature through ArcGIS server, and an Oracle trigger rejects it, will ArcGIS for Server be smart enough to return the reason why. – hedz09 Apr 29 '15 at 14:04
  • After some digging, constraints can do this. However, submitting an erroneous value to ArcGIS will respond with a generic error message. – hedz09 Apr 29 '15 at 17:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.