Field_Read_Only

Set a columns read only attribute.

Supported By

SQL Drivers (SQL Server, DB2 and ODBC)

Value

No, IgnoreChange, AcceptChange, ErrorOnChange

Associated Attribute

DF_FIELD_READ_ONLY (Enum list)

Remarks

In some cases it is not desirable that a certain column is changed through the driver. It is possible to handle certain column updates through triggers. If one goes that way, it would be needed to change every program that accesses that table so it no longer updates the column in question. Alternatively, one could use the Field_Read_Only keyword and the program logic does not have to change.

The keyword can be set to the following values:


VALUE

MEANING

No

Normal column. Data can be moved into the column in the normal way.

IgnoreChange

Any move of any value to the column will be ignored.

AcceptChange

Values can be moved into the column but these values will never be stored. This setting can be used when using an indexed column; values should be accepted in order to seed find operations.

ErrorOnChange

When the value in the column is changed, an error is generated (error 12315, CLIERR_FIELD_READONLY).

 

See Also

Column Keywords