I have a simple Oracle database (non SDE/Geodatabase) but I want to constrain the values that can be entered into a particular field (ex: the state names that can be stored/entered in a "State" field)

This is exactly what Domains are, in an ESRI geodatabase. Does something like this exist outside of Geodatabases? If so, how can I do it?

  • first oracle does support domain values, second does the software you are going to use recognize those?
    – Brad Nesom
    Commented May 30, 2011 at 7:41
  • have a look at check constraints, foreign key constraints, triggers. Commented May 30, 2011 at 10:48

3 Answers 3


You can try writing triggers for the database, checking for valid values (trigger restriction) and update the field accordingly. Check the following links:
Parts of a Trigger
Types of Triggers

If possible, you can do the same validation at the form (GUI) level and provide the user with some drop-down option.

You can also try putting these in a separate table which can be accessed by all.

Just some thoughts...

  • I am currently enforcing the validation at the GUI level, but I was interested in knowing, if there was a more elegant solution. Commented May 30, 2011 at 7:56
  • I think validating at the GUI level is the most manageable and pretty elegant solution. Till the time user is not getting an option to enter invalid data, things are fine. May I ask why would you like to implement it ta the DB level? It would require much more work though...
    – ujjwalesri
    Commented May 30, 2011 at 9:28
  • I want to do it at the database level, since the database might be accessed by multiple applications in the future. Commented Jun 1, 2011 at 4:00

I know the question is specific to Oracle -- I'm posting on the off chance someone is looking to emulate ESRI geodatabase domains using PostgreSQL/PostGIS. Simply create an enumerated data type.

According to the documentation:

Enumerated (enum) types are data types that comprise a static, ordered set of values. They are equivalent to the enum types supported in a number of programming languages. An example of an enum type might be the days of the week, or a set of status values for a piece of data.

I learned from quick internet search that enumerated types are not supported in Oracle but can be mimicked using stored procedures.

  • That seems like a very handy feature! Commented Jun 1, 2011 at 14:02

I was told that i need to use Lookup tables for this.

I have asked the following question on Stackoverflow about it: How to use LookUp tables in oracle?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.