Previous Topic: System-Generated KeysNext Topic: Avoiding Programmatic Joins


System-Generated Key Example

The following example shows the sequence object to generate a unique key and then returns that unique key to the application:

SELECT ACCT_ID
FROM FINAL TABLE
 (INSERT INTO UID1.ACCOUNT (ACCT_ID,NAME, TYPE, BALANCE)
  VALUES
  (NEXT VALUE FOR ACCT_SEQ,'Master Card','Credit',50000))