This document is archived and information here might be outdated. Recommended version. |
Given a column name, determine its qualification parts.
[Visual Basic .NET]
Public Sub ParseColumnName ( _
ByVal FullName As String, _
ByRef dbName As String, _
ByRef OwnerName As String, _
ByRef TableName As String, _
ByRef columnName As String _
)
[C#]
public void ParseColumnName (
string FullName,
ref string dbName,
ref string OwnerName,
ref string TableName,
ref string columnName
);
[C++]
HRESULT ParseColumnName(
BSTR FullName,
System.String* dbName,
System.String* OwnerName,
System.String* TableName,
System.String* columnName
);
[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* columnName [out]
columnName is a parameter of type BSTR*
Applications should use the ParseColumnName method to split the fully qualified name for a column in a table into its components (database, owner, table, column).
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 QualifyColumnName method to determine the qualified name of a column of a table for a given workspace.
The FullName paramter can be returned from 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 (the name object for the dataset is itself obtained using the IDataset::FullName property).
Empty strings will be returned for arguments that do not apply to the underlying DBMS. For example, supplying a FullName parameter of "gdb.Greeley_Parcels_1.AREA" to an ArcSDE Geodatabase on Oracle will result in:
dbName = ""
ownerName = "gdb"
TableName = "Greeley_Parcels_1"
columnName = "AREA"
// e.g., fieldName = field.Name;
// fieldName = "sde.Greeley_Parcels_1.AREA"
public void ISQLSyntax__ParseColumnName(IWorkspace workspace,string fieldName)
{
string nameOfDatabase;
string nameOfOwner;
string nameOfTable;
string nameOfColumn;
ISQLSyntax sqlSyntax = (ISQLSyntax)workspace;
sqlSyntax.ParseColumnName(fieldName, out nameOfDatabase, out nameOfOwner, out nameOfTable, out nameOfColumn);
Console.WriteLine("The database name is {0}", nameOfDatabase);
Console.WriteLine("The owner name is {0}", nameOfOwner);
Console.WriteLine("The table name is {0}", nameOfTable);
Console.WriteLine("The column name is {0}", nameOfColumn);
}