Definition
You can use the Archive_View_Name SQL function to determine the name of the archive view that was defined on a nonversioned, archive-enabled table.
When you enable archiving on a nonversioned table, several fields are added to the table that allow ArcGIS to implement archiving functionality. In addition, an archive view is created on the table. If you want to edit the table using SQL, you must do so through the archive view. This view automatically updates the archive fields that were added to the table when you enabled archiving.
Syntax
<geodatabase administrator schema>.archive_view_name(<table owner>, <table name>)
Return Type
String
Examples
The following examples show the use of Archive_View_Name in each supported database management system.
The first example queries the birds table, which is enabled for archiving.
The second example queries the trees table, which is not enabled for archiving and, therefore, does not have an associated archive view.
DB2
Example 1
VALUES sde.archive_view_name('LOGIN1', 'BIRDS')
BIRDS_EVW
Example 2
VALUES sde.archive_view_name('LOGIN1', 'TREES')
Informix
Example 1
EXECUTE FUNCTION sde.archive_view_name('login1', 'birds');
birds_evw
Example 2
EXECUTE FUNCTION sde.is_archive_enabled('login1', 'trees');
Oracle
Example 1
SELECT sde.gdb_util.ARCHIVE_VIEW_NAME('LOGIN1', 'BIRDS')
FROM DUAL;
SDE.GDB_UTIL.IS_ARCHIVE_ENABLED('LOGIN1', 'BIRDS')
---------------------------------------------------------
BIRDS_EVW
Example 2
SELECT sde.gdb_util.ARCHIVE_VIEW_NAME('LOGIN1', 'TREES')
FROM DUAL;
SDE.GDB_UTIL.IS_ARCHIVE_ENABLED('LOGIN1', 'TREES')
---------------------------------------------------------
PostgreSQL
Example 1
SELECT sde.archive_view_name('login1', 'birds');
birds_evw
Example 2
SELECT sde.archive_view_name('login1', 'trees');
SQL Server
Example 1
DECLARE @owner varchar(128) = 'login1';
DECLARE @table varchar(128) = 'birds';
SELECT dbo.archive_view_name(@owner, @table)
BIRDS_EVW
Example 2
DECLARE @owner varchar(128) = 'login1';
DECLARE @table varchar(128) = 'trees';
SELECT dbo.archive_view_name(@owner, @table)