Example: Updating IDENTITY defined as GENERATED BY DEFAULT
CREATE TABLE Test_sqlUpdateByDefault (
idValue INTEGER GENERATED BY DEFAULT AS IDENTITY,
acctNum LONG,
name STRING,
primary key(acctNum))
INSERT INTO Test_sqlUpdateByDefault VALUES (DEFAULT, 123456, 'joe')
INSERT INTO Test_sqlUpdateByDefault VALUES (400, 23456,'sam')
INSERT INTO Test_sqlUpdateByDefault VALUES (500, 34567,'carl')
Table Test-sqlUpdateByDefault will have the following rows:
1, 123456, 'joe'
400, 23456, 'jasmine'
500, 34567, 'carl'
UPDATE Test_sqlUpdateByDefault
SET idValue = 100
WHERE acctNum = 123456
The above UPDATE statement will replace row (1, 123456, 'joe') with (100, 123456, 'joe') in the database.