ArcObjects Library Reference  (GeoDatabase)    

ISQLSyntax.ParseTableName Method

Given a table name, determine its qualification parts.

[Visual Basic 6.0]
Sub ParseTableName(
    ByVal FullName As String, _
    dbName As String, _
    ownerName As String, _
    TableName As String _
)
[Visual Basic .NET]
Public Sub ParseTableName ( _
    ByVal FullName As String, _
    ByRef dbName As String, _
    ByRef ownerName As String, _
    ByRef TableName As String _
)
[C#]
public void ParseTableName (
    string FullName,
    ref string dbName,
    ref string ownerName,
    ref string TableName
);
[Java]
public void parseTableName (
    String FullName,
    String dbName,
    String ownerName,
    String TableName
)
throws
    IOException,
    AutomationException
[C++]
HRESULT ParseTableName(
  BSTR FullName,
  BSTR* dbName,
  BSTR* ownerName,
  BSTR* TableName
);
[C++]

Parameters

FullName [in]

  FullName is a parameter of type BSTR

dbName [out]

  dbName is a parameter of type BSTR

ownerName [out]

  ownerName is a parameter of type BSTR

TableName [out]

  TableName is a parameter of type BSTR

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Errors Returned

-2147216057 - FDO_E_SE_INVALID_PARAM_VALUE

Invalid parameter supplied as input. A database parameter may have been supplied to an underlying DBMS that does not support multiple databases. For example, a FullName arguement of vtest.gdb.mytable is supplied to an Oracle database.

Remarks

Applications should use the ParseTableName method to split the fully qualified name of a table into its components (database, owner, table).  ParseTableName can also be used to return the components of any fully qualified name of a dataset such as feature classes, feature datasets, geometric networks and topologies.

Applications that wish to be RDBMS independent should not assume that . is the delimiter used to separate the components of a fully qualified dataset name. Use the QualifyTableName method to determine the qualified name of a dataset for a given workspace.

The FullName parameter refers to the fully qualified name of the dataset and is returned by the  IDataset::Name property for a dataset in a geodatabase and the IDatasetName::Name property for a dataset name object. Both methods return the fully qualified name for the dataset.

Empty strings will be returned for arguments that do not apply to the underlying DBMS. For example, supplying a FullName parameter of "MyTable" to a Personal or File Geodatabase will result in:

dbName = ""

ownerName = ""

TableName = "MyTable"

While supplying a FullName parameter of "gdb.MyTable" to an ArcSDE Geodatabase on Oracle will result in:

dbName = ""

ownerName = "gdb"

TableName = "MyTable"

[C#]


    public void ISQLSyntax__ParseTableName(IDataset dataset)
    {
        string nameOfDatabase;
        string nameOfOwner;
        string nameOfTable;
        string datasetName = dataset.Name;

        ISQLSyntax sqlSyntax = (ISQLSyntax)dataset.Workspace;
        sqlSyntax.ParseTableName(datasetName, out nameOfDatabase, out nameOfOwner, out nameOfTable);

        Console.WriteLine("The database name is {0}", nameOfDatabase);
        Console.WriteLine("The owner name is {0}", nameOfOwner);
        Console.WriteLine("The table name is {0}", nameOfTable);
    }

[Visual Basic 6.0]

'Assume we already have a reference to the IWorkspace as pWor and a reference the IDataset as pDS
Dim pSQLSyntax As ISQLSyntax
Dim strFullName As String, strDB As String, strOwner As String, strTable As String

strFullName = pDS.Name

Set pSQLSyntax = pWor
pSQLSyntax.ParseTableName strFullName, strDB, strOwner, strTable
Debug.Print strDB
Debug.Print strOwner
Debug.Print strTable

See Also

ISQLSyntax Interface