Definition
Is_Versioned takes a table as an input parameter and returns TRUE if the table is registered to participate in traditional versioning. If the table is not registered for traditional versioning, Is_Versioned returns FALSE. If the table is not registered with the geodatabase, Is_Versioned returns NOT REGISTERED. Be aware that if a table doesn't exist in the database (for example, if you mistyped the name), a message that the table is not registered is returned because Is_Versioned only checks the geodatabase system tables for the presence or absence of the 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
TRUE is returned if the specified table is registered with the geodatabase and has been registered for traditional versioning.
FALSE is returned if the specified table is registered with the geodatabase but has not been registered for traditional versioning.
NOT REGISTERED is returned if the specified table is not registered with the geodatabase, does not exist in the database, or you do not have access to the table.
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 participates in traditional versioning.
The second example queries the crews table owned by crewboss to determine if it participates in traditional versioning. Crews is not registered for traditional versioning; 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')
NOT REGISTERED
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