This example shows the method for specifying a sequence in the SQL statement of an application
program. In the example, employee numbers (EMPLOYEENO) are incremented and assigned to new
employees.
Example 2:
This example shows the method for automatically inserting a sequence number in an insertion line
using a sequence. In the example, new order numbers (ORDERNO) are assigned by incrementing
order numbers (ORDERNO) in the order table (ORDERTBL).
To insert a sequence number automatically into an insertion line, use the DEFAULT clause to specify a
sequence in a table definition column. In the INSERT statement of the application program, omit the
column where a sequence is specified in the DEFAULT clause or specify the DEFAULT clause as the
insertion value.
127