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.GET_TABLE_VERSION Function

Displays the data dictionary version of a table. Use this procedure in WAN deployments to verify that the version of a table matches 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 the SYS.INCREMENT_TABLE_VERSION procedure 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.GET_TABLE_VERSION (
IN SCHEMANAME VARCHAR(128),
IN TABLENAME VARCHAR(128),
)
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.

Example

Display the version of the FLIGHTS table in the local SQLFire distributed system:
sqlf> values sys.get_table_version('APP','FLIGHTS');
1          
-----------
1          

1 row selected

See also SYS.INCREMENT_TABLE_VERSION.