Interface ISQLSyntax
- Namespace
- ESRI.ArcGIS.Geodatabase
- Assembly
- ESRI.Server.Geodatabase.dll
Provides access to members that supply information about SQL functionality.
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("18E2854E-EDC8-11D2-AAEF-00C04FA37849")]
public interface ISQLSyntax
Remarks
Applications should use the ISQLSyntax interface to help them construct SQL queries and where clauses using database-specific clauses, predicates and special characters.
Methods
GetDelimitedIdentifierCase()
True if DBMS's quoted identifiers are case sensitive.
bool GetDelimitedIdentifierCase()
Returns
GetFunctionName(esriSQLFunctionName)
DBMS dependent SQL function names.
string GetFunctionName(esriSQLFunctionName sqlFunc)
Parameters
sqlFuncesriSQLFunctionName
Returns
GetIdentifierCase()
True if DBMS's identifiers are case sensitive.
bool GetIdentifierCase()
Returns
GetInvalidCharacters()
The list of invalid characters used in literals (if any).
string GetInvalidCharacters()
Returns
GetInvalidStartingCharacters()
The list of invalid characters used in literals (if any).
string GetInvalidStartingCharacters()
Returns
GetKeywords()
The list of DBMS specific reserved keywords.
IEnumBSTR GetKeywords()
Returns
GetSpecialCharacter(esriSQLSpecialCharacters)
Special DBMS dependent SQL characters.
string GetSpecialCharacter(esriSQLSpecialCharacters sqlSC)
Parameters
sqlSCesriSQLSpecialCharacters
Returns
Remarks
The GetSpecialCharacter can be used to return the DBMS dependent character that represents an SQL special character, including the following:
• esriSQL_WildcardManyMatch ( % in SQL_92, * in Jet 4.0)
• esriSQL_WildcardSingleMatch ( _ in SQL_92, ? in Jet 4.0)
• esriSQL_DelimitedIdentifierPrefix ( " in SQL_92, [ in Jet 4.0)
• esriSQL_DelimitedIdentifierSuffix (" in SQL_92, ] in Jet 4.0)
GetStringComparisonCase()
True if string comparisons are case sensitive.
bool GetStringComparisonCase()
Returns
GetSupportedClauses()
Supported SQL clauses.
int GetSupportedClauses()
Returns
GetSupportedPredicates()
Supported SQL predicates.
int GetSupportedPredicates()
Returns
ParseColumnName(string, out string, out string, out string, out string)
Given a column name, determine its qualification parts.
void ParseColumnName(string FullName, out string dbName, out string OwnerName, out string TableName, out string columnName)
Parameters
Remarks
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);
}
ParseTableName(string, out string, out string, out string)
Given a table name, determine its qualification parts.
void ParseTableName(string FullName, out string dbName, out string OwnerName, out string TableName)
Parameters
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"
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);
}
QualifyColumnName(string, string)
Given a table name and column name, returns its fully qualified name.
string QualifyColumnName(string TableName, string columnName)
Parameters
Returns
Remarks
Applications should use the QualifyTableName and QualifyColumnName methods to construct fully qualified dataset and column names.
QualifyTableName(string, string, string)
Given a database, owner, and table name, return its fully qualified name.
string QualifyTableName(string dbName, string OwnerName, string TableName)
Parameters
Returns
Remarks
Applications should use the QualifyTableName and QualifyColumnName methods to construct fully qualified dataset and column names.