Note: Documentation for Pivotal SQLFire 1.1.x is now available at http://docs.gopivotal.com/sqlfire/index.html. Please reference the docs.gopivotal.com site for the latest and most up-to-date documentation on SQLFire. The vFabric SQLFire documentation site will no longer be updated.

SYS.INCREMENT_TABLE_VERSION

Increments the data dictionary version of a table by a specified amount. Use this procedure in WAN deployments to manually set the version of a table to match an identical table in another SQLFire distributed system.

A table must have identical column definitions in each cluster in order for SQLFire to replicate it between clusters. As a best practice, use the same DDL command in each cluster to create the table. If you achieve identical column definitions using different DDL commands (for example, by using ALTER TABLE to change one table to match another), then you may need to use SYS.INCREMENT_TABLE_VERSION to ensure that both tables have the same version in each cluster. Use the SYS.GET_TABLE_VERSION Function to determine the data dictionary version of individual tables.

Syntax

SYS.INCREMENT_TABLE_VERSION (
IN SCHEMANAME VARCHAR(128),
IN TABLENAME VARCHAR(128),
IN INCREMENT INTEGER
)
SCHEMANAME
The schema in which the table resides. Specify the schema in all uppercase letters.
TABLENAME
The name of the table to increment. Specify the table name in all uppercase letters.
INCREMENT
An integer value by which to increment the current table version.

Example

For this example, assume that the data dictionary in SQLFire distributed system 1 stores table FLIGHTS at version 1:
sqlf> values sys.get_table_version('APP','FLIGHTS');
1          
-----------
1          

1 row selected
However, in SQLFire distributed system 2, the data dictinoary stores table FLGITHS at version 2:
sqlf> values sys.get_table_version('APP','FLIGHTS');
1          
-----------
2          

1 row selected
The above situation can occur if, for example, ALTER TABLE was used on the FLIGHTS table in distributed system 2. If the tables are otherwise equal (having identical column definitions), you can use SYS.INCREMENT_TABLE_VERSION to make the version of FLIGHTS in distributed system 1 equivalent for WAN replication purposes. In distributed system 1:
sqlf> call sys.increment_table_version('APP','FLIGHTS',1);
Statement executed.
sqlf> values sys.get_table_version('APP','FLIGHTS');
1          
-----------
2    

1 row selected      

See Create Tables with Gateway Senders.