GlobalID_Name

Definition

GlobalID_Name takes a table as an input parameter and returns the name of the global ID field in the table.

The global ID field is added to allow the table to participate in geodatabase replication or offline map use. The GlobalID_Name function does not return the name of GUID fields.

You would use GlobalID_Name if your global ID fields are created programmatically using ArcObjects and you are unsure of the name of the field that is created. If you added the global ID field to the table using ArcGIS for Desktop or the Add Global IDs geoprocessing tool or Python script, the name of the field is always globalid; therefore, you do not need to use GlobalID_Name to discover the name of the field.

A null string is returned if the table does not have a global ID field. If the table is not registered with the geodatabase or does not exist, a message indicating the table is not registered with the geodatabase or a null string is returned.

Syntax

<geodatabase administrator schema>.globalid_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 GlobalID_Name function in each database type that supports it.

The first example queries for the name of the global ID field in the signs table owned by insp3.

The second example queries for the name of the global ID field in the addresses table owned by planner. The table does not contain a global ID column.

The third example queries for the name of the global ID field in the partners table owned by insp3. The partners table is not registered with the geodatabase.

DB2

VALUES sde.globalid_name('INSP3', 'SIGNS')

SIGNID
VALUES sde.globalid_name('PLANNER', 'ADDRESSES')
VALUES sde.globalid_name('INSP3', 'PARTNERS')

Oracle

SELECT sde.gdb_util.globalid_name('INSP3', 'SIGNS')
FROM DUAL;

SDE.GDB_UTIL.GLOBALID_NAME('INSP3', 'SIGNS')
--------------------------------------------------
SIGNID
SELECT sde.gdb_util.globalid_name('PLANNER', 'ADDRESSES')
FROM DUAL;

SDE.GDB_UTIL.GLOBALID_NAME('PLANNER', 'ADDRESSES')
--------------------------------------------------
SELECT sde.gdb_util.globalid_name('INSP3', 'PARTNERS')
FROM DUAL;

SDE.GDB_UTIL.GLOBALID_NAME('INSP3', 'PARTNERS')
--------------------------------------------------

ORA-20220: Class INSP3.PARTNERS not registered to the Geodatabase.

PostgreSQL

SELECT sde.globalid_name('insp3', 'signs');

signid
SELECT sde.globalid_name('planner', 'addresses');
SELECT sde.globalid_name('insp3', 'partners');

NOT REGISTERED

SQL Server

SELECT sde.globalid_name('insp3', 'signs');

SignID
SELECT sde.globalid_name('planner', 'addresses');
SELECT sde.globalid_name('insp3', 'partners');

NOT REGISTERED

Related Topics

6/19/2015