Specifying an identity column

SQL Anywhere allows you to specify that the value for a column in a new row is to be automatically assigned. This kind of column is called an identity column.

For example, SQL Anywhere allow you to define autoincrement columns so that the column for a new row is automatically assigned a value one greater than that of the previous highest value. You could use this feature to specify that the order number should be automatically incremented when someone adds a new order:

Figure 20-3: Selecting identity columns for autoincrementation

The sample shows a portion of the Specify Update Properties dialog box. A drop down list with the label Identity Column displays the word none in parentheses.

By specifying an identity column in the Specify Update Properties dialog box, you tell PocketBuilder to bring back the value of a new row's identity column after an insert in the DataWindow object so that users can see it.