Auto-incremented columns (serials)

How to implement automatic record keys.

IBM® Informix® provides the SERIAL, BIGSERIAL or SERIAL8 data types which can be emulated with database drivers for most non-Informix database engines by using native sequence generators (when "ifxemul.serial" FGLPROFILE setting is true).

But, this requires additional configuration and maintenance tasks. If you plan to review the programming pattern of sequences, it is recommended that you use a portable implementation instead of the serial emulation provided by the database drivers.

This section describes different solutions to implement auto-incremented fields. The preferred implementation is the solution using SEQUENCES.

Table 1. SERIAL emulation by database server brand
Database Server Type Serial type support
IBM Informix Yes, this is a native Informix feature
Microsoft™ SQL Server Emulated, see details
Oracle® MySQL / MariadDB Emulated, see details
Oracle Database Server Emulated, see details
PostgreSQL Emulated, see details
SAP HANA® Emulated, see details
SQLite Emulated, see details
Dameng® Emulated, see details