Column Validation

Use the Validation page of the Column Property Editor to setup basic field validation and more advanced field validation using an SQL query.

Basic validation parameters allow you to ensure that: values are entered for a field by making it a Required field.

When defining a database table in SQL, a field can be defined as NOT NULL, which means that a value is required. If this setting is used in SQL, it is best practice to define a default value for the field if it is not a primary key field. The relevance of this to the "Value required" setting is that the scope of the setting is limited to the dataview in which it is configured. Therefore, the two cases in with you should use this setting are:

1. If the database allows nulls on the column, but in the dataview you want to force the user to provide a value.

2. If the database does not allow nulls for this column AND you use the setting in conjunction with an intialisation setting for the column. This could be the SQL default or another value, but an initialisation must be specified if NOT NULL is set in the database

Do NOT have "Value required" as true without an initialisation, as Geobank will validate the row of data BEFORE committing it to the database. Thus the database does not have opportunity to apply the database-level SQL default. Consequently, if the field id is blank, Geobank reports that a value is required, which will be confusing to users who know that a default is specified in the database.

Advanced validation using a query is disabled by default. To set more advanced validation for a field, select the List Of Values check box and enter or load an SQL statement in the query window.

If you are generating a lookup list, specify the name of the Lookup Result field. You can enforce validation by limiting a user's response to the values in the lookup list.

Select the Apply a range check option to specify a range.

You can either enter minimum and maximum range values or use query to generate a minimum and maximum range: