Search code examples
pervasivepervasive-sql

How to Auto-Increment a big int in Pervasive


Using the graphical table editor, in Pervasive 13, how can I set a big int as a unique auto-incrementing id?


Solution

  • According to the documentation for ZEN (PSQL) v13, it says:

    Btrieve
    In Btrieve operations, the length of the AUTOINC data type can now be 8 bytes as well as 2 or 4 bytes. The new length is available in files using 9.5 format and later. Btrieve files using the new 8-byte AUTOINC segment cannot be opened by engines from earlier releases.

    It appears that the 8 byte integer is not available from the SQL side of the Zen (PSQL) engine and is only available from the Btrieve API.

    You might be able to create the file with the 8 byte autoincrement and then create a SQL definition for the table but I'm not sure. You can't do it from the graphical table editor.