KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Toggling AUTO_INCREMENT for a long int field via code
PRODUCT: 4D | VERSION: 13.4 | PLATFORM: Mac & Win
Published On: June 5, 2014

4D v13.4 introduced the ability to modify the AUTO_INCREMENT property of a Long Int field via code. This also introduced the new MODIFY keyword for specifying the column to modify.

Here is an example of enabling auto_increment for [Table_1]id:

Begin SQL
   ALTER TABLE Table_1 MODIFY id ENABLE AUTO_INCREMENT;
End SQL


Here is an example of disabling auto_increment for [Table_1]id:

Begin SQL
   ALTER TABLE Table_1 MODIFY id DISABLE AUTO_INCREMENT;
End SQL


Here is the property this is referring to: