Field_Read_Only
Set a column's 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 for a certain column to be changed through the driver. It is possible to handle certain column updates through triggers. If one goes that route, it would be necessary 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). |