Modifying the values of key fields

The ability to modify key fields of a record in a table differs, based upon the database manager used for the table. If you’re using the c-tree or SQL database managers, you can always modify the contents of key fields of a record in a table. If you use the Pervasive.SQL database manager, the contents of key fields can be changed only when the Modifiable key option is marked. If you try to change the contents of key fields of a Pervasive.SQL table that doesn’t have the Modifiable key option marked, an alert message will appear explaining that you attempted to change a non-modifiable key.

The following example illustrates modifying a key field. The change statement was used to read the record shown in the following illustration.

[spacer]

The value of the key field Last Name was changed from Schulz to Smith and the record was saved using the save table statement. If the database manager being used allows modifying key values, the record would be saved. The record would then contain the new last name as shown in the following illustration.

[spacer]

If the database manager doesn’t allow key values to be modified, an alert message would be displayed indicating you had attempted to change a non-modifiable key.

 


Documentation Feedback