RowID_Name

Definition

RowID_Name takes a table as an input parameter and returns the name of the table's ObjectID (or RowID) field. This is useful if you want to perform nonversioned edits against a geodatabase table using SQL; you must know the name of the ObjectID field so you can insert values to it.

An error message or null is returned if the table is not registered with the geodatabase.

Syntax

<geodatabase administrator schema>.rowid_name(<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 RowID_Name function in each database type.

The first example queries for the name of the RowID column registered for the customers table owned by mgr.

The second example queries for the name of the RowID column registered for the inventory table. The inventory table is not registered with the geodatabase and, therefore, does not have a registered RowID column.

DB2

VALUES sde.rowid_name('MGR', 'CUSTOMERS')

ID
VALUES sde.rowid_name('MGR', 'INVENTORY')

Application raised error or warning with diagnostic text: 
"MGR.INVENTORY is not registered to the geodatabase".

Oracle

SELECT sde.gdb_util.rowid_name('MGR', 'CUSTOMERS')
FROM DUAL;

SDE.GDB_UTIL.ROWID_NAME('MGR', 'CUSTOMERS')
--------------------------------------------------
ID
SELECT sde.gdb_util.rowid_name('MGR', 'INVENTORY')
FROM DUAL;

SDE.GDB_UTIL.ROWID_NAME('MGR', 'INVENTORY')
----------------------------------------------------
SELECT sde.gdb_util.rowid_name('MGR', 'INVENTORY') FROM DUAL;
*
ERROR at line 1:
ORA-20220: Class MGR.INVENTORY not registered to the Geodatabase.

PostgreSQL

SELECT sde.rowid_name('mgr', 'customers');

id
SELECT sde.rowid_name('mgr', 'inventory');

NOT REGISTERED

SQL Server

SELECT sde.rowid_name('mgr', 'customers');

id
SELECT sde.rowid_name('mgr', 'inventory');

NULL

Related Topics

6/19/2015