ISQLSyntax Interface

Provides access to members that supply information about SQL functionality.

Description

ISQLSyntaxis an interface that returns which SQL predicates, clauses, and other database specific constraints are supported by a workspace.

Members

Name Description
Method GetDelimitedIdentifierCase True if DBMS's quoted identifiers are case sensitive.
Method GetFunctionName DBMS dependent SQL function names.
Method GetIdentifierCase True if DBMS's identifiers are case sensitive.
Method GetInvalidCharacters The list of invalid characters used in literals (if any).
Method GetInvalidStartingCharacters The list of invalid characters used in literals (if any).
Method GetKeywords The list of DBMS specific reserved keywords.
Method GetSpecialCharacter Special DBMS dependent SQL characters.
Method GetStringComparisonCase True if string comparisons are case sensitive.
Method GetSupportedClauses Supported SQL clauses.
Method GetSupportedPredicates Supported SQL predicates.
Method ParseColumnName Given a column name, determine its qualification parts.
Method ParseTableName Given a table name, determine its qualification parts.
Method QualifyColumnName Given a table name and column name, returns its fully qualified name.
Method QualifyTableName Given a database, owner, and table name, return its fully qualified name.

ISQLSyntax.GetDelimitedIdentifierCase Method

True if DBMS's quoted identifiers are case sensitive.

Public Function GetDelimitedIdentifierCase ( _
) As Boolean
public bool GetDelimitedIdentifierCase (
);

Description

GetDelimitedIdentifierCasereturns a Boolean indicating whether delimited identifiers are case sensitive in the DBMS of the underlying workspace.

An identifier is delimited in most DBMSs with square brackets. A notable exception is Access, which uses quotation marks.

ISQLSyntax.GetFunctionName Method

DBMS dependent SQL function names.

Public Function GetFunctionName ( _
    ByVal sqlFunc As esriSQLFunctionName _
) As String
public string GetFunctionName (
    esriSQLFunctionName sqlFunc
);

ISQLSyntax.GetIdentifierCase Method

True if DBMS's identifiers are case sensitive.

Public Function GetIdentifierCase ( _
) As Boolean
public bool GetIdentifierCase (
);

Description

GetIdentifierCasereturns a Boolean indicating whether identifiers are case sensitive in the DBMS of the underlying workspace.

ISQLSyntax.GetInvalidCharacters Method

The list of invalid characters used in literals (if any).

Public Function GetInvalidCharacters ( _
) As String
public string GetInvalidCharacters (
);

Description

GetInvalidCharactersreturns a String that contains all the invalid characters for the Workspace object used as the query interface for ISQLSyntax .

ISQLSyntax.GetInvalidStartingCharacters Method

The list of invalid characters used in literals (if any).

Public Function GetInvalidStartingCharacters ( _
) As String
public string GetInvalidStartingCharacters (
);

Description

GetInvalidStartingCharactersreturns a String containing all the invalid starting characters for the DBMS that the Workspace object that was used as a query interface for the ISQLSyntax uses.

ISQLSyntax.GetKeywords Method

The list of DBMS specific reserved keywords.

Public Function GetKeywords ( _
) As IEnumBSTR
public IEnumBSTR GetKeywords (
);

Description

GetKeywordsreturns a IEnumBStr list of keywords that are specific to the DBMS of the Workspace object used as the query interface for ISQLSyntax .

ISQLSyntax.GetSpecialCharacter Method

Special DBMS dependent SQL characters.

Public Function GetSpecialCharacter ( _
    ByVal sqlSC As esriSQLSpecialCharacters _
) As String
public string GetSpecialCharacter (
    esriSQLSpecialCharacters sqlSC
);

Description

GetSpecialCharacterreturns a String value that indicates which character is used to represent the esriSQLSpecialCharacters value specified.

Remarks

The GetSpecialCharactercan 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)

ISQLSyntax.GetStringComparisonCase Method

True if string comparisons are case sensitive.

Public Function GetStringComparisonCase ( _
) As Boolean
public bool GetStringComparisonCase (
);

Description

GetStringComparisonCasereturns a Boolean indicating whether string comparison is case sensitive in the workspace's DBMS.

ISQLSyntax.GetSupportedClauses Method

Supported SQL clauses.

Public Function GetSupportedClauses ( _
) As Integer
public int GetSupportedClauses (
);

Description

GetSupportedClausesreturns a Long value that indicates which of the esriSQLClauses are supported.

A value of -1 indicates that all clauses are supported by the workspace, while a value of 0 indicates that no clauses are supported by the workspace. Bitwise AND operations can be used with the esriSQLClauses enumeration's values to determine support for individual clauses.

ISQLSyntax.GetSupportedPredicates Method

Supported SQL predicates.

Public Function GetSupportedPredicates ( _
) As Integer
public int GetSupportedPredicates (
);

Description

GetSupportedPredicatesreturns a Long value that indicates which of the esriSQLPredicatesare supported.

A value of -1 indicates that all predicates are supported by the workspace, while a value of 0 indicates that no predicates are supported by the workspace. Bitwise AND operations can be used with the esriSQLPredicates enumeration's values to determine support for individual predicates.

ISQLSyntax.ParseColumnName Method

Given a column name, determine its qualification parts.

Public Sub ParseColumnName ( _
    ByVal FullName As String, _
    ByRef dbName As String, _
    ByRef OwnerName As String, _
    ByRef TableName As String, _
    ByRef columnName As String _
)
public void ParseColumnName (
    string FullName,
    ref string dbName,
    ref string OwnerName,
    ref string TableName,
    ref string columnName
);

Remarks

Applications should use the ParseColumnNamemethod 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::Nameproperty for a dataset in a Geodatabase and the IDatasetName::Nameproperty 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::FullNameproperty).

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);

    }

ISQLSyntax.ParseTableName Method

Given a table name, determine its qualification parts.

Public Sub ParseTableName ( _
    ByVal FullName As String, _
    ByRef dbName As String, _
    ByRef OwnerName As String, _
    ByRef TableName As String _
)
public void ParseTableName (
    string FullName,
    ref string dbName,
    ref string OwnerName,
    ref string TableName
);

Errors Returned

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 argument of vtest.gdb.mytable is supplied to an Oracle database.

Remarks

Applications should use the ParseTableNamemethod 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::Nameproperty for a dataset in a geodatabase and the IDatasetName::Nameproperty 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);

    }

ISQLSyntax.QualifyColumnName Method

Given a table name and column name, returns its fully qualified name.

Public Function QualifyColumnName ( _
    ByVal TableName As String, _
    ByVal columnName As String _
) As String
public string QualifyColumnName (
    string TableName,
    string columnName
);

Remarks

Applications should use the QualifyTableNameand QualifyColumnNamemethods to construct fully qualified dataset and column names.

ISQLSyntax.QualifyTableName Method

Given a database, owner, and table name, return its fully qualified name.

Public Function QualifyTableName ( _
    ByVal dbName As String, _
    ByVal OwnerName As String, _
    ByVal TableName As String _
) As String
public string QualifyTableName (
    string dbName,
    string OwnerName,
    string TableName
);

Remarks

Applications should use the QualifyTableNameand QualifyColumnNamemethods to construct fully qualified dataset and column names.

Classes that implement ISQLSyntax

Classes Description
SqlWorkspace (esriDataSourcesGDB) Sql workspace
Workspace Workspace Object.

Remarks

Applications should use the ISQLSyntaxinterface to help them construct SQL queries and where clauses using database-specific clauses, predicates and special characters.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.