Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 17 » SQL Anywhere Server - Database Administration » Database configuration » Database options » Alphabetical list of database options

global_database_id option

Controls the range of values for columns created with DEFAULT GLOBAL AUTOINCREMENT.

For use in generating unique primary keys in a replication environment.

Allowed values

Non-negative integer

Default

2147483647

Scope
  PUBLIC role For current user For other users
Allowed to set permanently? Yes, with SET ANY SYSTEM OPTION No No
Allowed to set temporarily? Yes, with SET ANY SYSTEM OPTION No No
Remarks

The value you specify for this option is the starting value. For columns created with DEFAULT GLOBAL AUTOINCREMENT, when a row is inserted into the table that does not include a value for the DEFAULT GLOBAL AUTOINCREMENT column, the database server generates a value for the column. The value is determined by the global_database_id value and the partition size for the column.

Setting global_database_id to the default value indicates that DEFAULT GLOBAL AUTOINCREMENT is disabled. In this case NULL is generated as a default.

You can find the value of the option in the current database using the following statement:

SELECT DB_PROPERTY( 'GlobalDBID' );

This feature is of particular use in replication environments to ensure unique primary keys.

Example

The following example sets the database identification number to 100.

SET OPTION PUBLIC.global_database_id = '100';