Is_Versioned

Definition

Is_Versioned takes a table as an input parameter and returns TRUE if the table is registered as versioned. If the table is not registered as versioned, Is_Versioned returns FALSE. If the table is not registered with the geodatabase, a message is returned stating that fact. You will also get a message indicating that the table is not registered with the geodatabase if you provide the name of a table that does not exist in the database (for example, if you mistype the table name), because Is_Versioned checks to see if the table is present in the TABLE_REGISTRY system table.

Syntax

<geodatabase administrator schema>.is_versioned (<table owner>, <table name>)

In most geodatabases, the geodatabase administrator schema is sde. However, it is dbo in dbo-schema geodatabases in SQL Server, and in user-schema geodatabases in Oracle, it is the name of the user's schema.

Return type

String

Examples

The following are examples of using the Is_Versioned function in each supported database type.

The first example queries the laterals table owned by tech3 to determine if it is versioned.

The second example queries the crews table owned by crewboss to determine if it is versioned. Crews is not versioned; therefore, FALSE is returned.

The third example queries the service_areas table owned by dentry. The service_areas table is not registered with the geodatabase.

DB2

VALUES sde.is_versioned('TECH3', 'LATERALS')

TRUE
VALUES sde.is_versioned('CREWBOSS', 'CREWS')

FALSE
VALUES sde.is_versioned('DENTRY', 'SERVICE_AREAS')

Application raised error or warning with diagnostic text: 
"MYDB.DENTRY.SERVICE_AREAS is not registered to the geodatabase".

Oracle

SELECT sde.gdb_util.is_versioned('TECH3', 'LATERALS')
FROM DUAL;

SDE.GDB_UTIL.IS_VERSIONED('TECH3', 'LATERALS')
--------------------------------------------------
TRUE
SELECT sde.gdb_util.is_versioned('CREWBOSS', 'CREWS')
FROM DUAL;

SDE.GDB_UTIL.IS_VERSIONED('CREWBOSS', 'CREWS')
--------------------------------------------------
FALSE
SELECT sde.gdb_util.is_versioned('DENTRY', 'SERVICE_AREAS')
FROM DUAL;

SDE.GDB_UTIL.IS_VERSIONED('DENTRY', 'SERVICE_AREAS')
----------------------------------------------------

NOT REGISTERED

PostgreSQL

SELECT sde.is_versioned('tech3', 'laterals');

TRUE
SELECT sde.is_versioned('crewboss', 'crews');

FALSE
SELECT sde.is_versioned('dentry', 'services_areas');

NOT REGISTERED

SQL Server

SELECT dbo.is_versioned('tech3', 'laterals');

TRUE
SELECT dbo.is_versioned('crewboss', 'crews');

FALSE
SELECT dbo.is_versioned('dentry', 'services_areas');

NOT REGISTERED
6/19/2015