sp_sqlgetinfo

Description

Provides information about SQL grammar, syntax, and capabilities that the target DBMS supports.

Syntax

sp_sqlgetinfo [attribute_name]

Parameters

attribute_name

is the name of a particular SQL option.

Usage

Result set information is described in the following sections.

Table 12-5 shows the format.

Table 12-5: Format for sp_sqlgetinfo

sql_option

varchar(30)

not null

sql_value

varchar(255)

null

NoteIf the sql_value column is NULL, this option is not supported for the target DBMS.

Table 12-6 lists options for the ECDA Option for ODBC and SQL options A through L.

Table 12-6: SQL options for sp_sqlgetinfo (A through L)

SQL option

Description

ICD_Cursor_Support

Bitmask indicating cursor support.

ICD_Dynamic_Support

Bitmask indicating dynamic statement support.

ICD_Execdirect

Bitmask indicating how dynamic execdirect statement is supported.

ICD_Language_Support

Bitmask indicating language statement support. No parameter marker support.

ICD_Longtypes_Supported

Support for long types as parameters.

ICD_Modify_Groupby

Intersolv driver insures GROUP BY clause when aggregate functions are used as part of the select list.

SQL_Accessible_Procedures

User can execute all procedures returned by sp_stored_procedures.

SQL_Accessible_Tables

User is guaranteed SELECT privileges to tables returned by sp_tables.

SQL_Active_Connections

No known limit to the number of connections.

SQL_Active_Statements

No known limit to the number of statements for a connection.

SQL_Alter_Table

Bitmask indicating which clauses in ALTER TABLE are supported.

SQL_Bookmark_Persistence

Bitmask enumerating through which bookmarks persist. None supported.

SQL_Column_Alias

Support for column alias.

SQL_Concat_Null_Behavior

Bitmask indicating how the DBMS handles concatenations with NULLS.

SQL_Convert_Bigint SQL_Convert_Binary SQL_Convert_Bit SQL_Convert_Char SQL_Convert_Date SQL_Convert_Decimal SQL_Convert_Double SQL_Convert_Float SQL_Convert_Integer SQL_Convert_Longvarbinary SQL_Convert_Longvarchar SQL_Convert_Numeric SQL_Convert_Real SQL_Convert_Smallint SQL_Convert_Time SQL_Convert_Timestamp SQL_Convert_Tinyint SQL_Convert_Varbinary SQL_Convert_Varchar

Bitmask indicating conversions “to type” supported.

SQL_Convert_Functions

Bitmask indicating conversion functions supported.

SQL_Correlation_Name

Table correlation names supported.

SQL_CSP_Support

Sybase/Intersolv extension for supporting CSPs. Value = 16383.

SQL_Cursor_Commit_Behavior

Bitmask indicating how a commit operation affects a cursor.

SQL_Cursor_Rollback_Behavior

Bitmask indicating how a rollback operation affects a cursor.

SQL_Cursor_Sensitivity

A value indicating support for cursor sensitivity.

SQL_Database_Name

Value provided by the DirectConnect server.

SQL_Date_Source_Read_Only

The data source is read/write.

SQL_DBMS_Name

The target DBMS name. A maximum of 30 characters is returned.

SQL_DBMS_Ver

The target DBMS version in the form ##.##.####. A maximum of 30 characters is returned. The version string may have target-specific information that follows.

SQL_Default_TXN_Isolation

Bitmask indicating the default transaction level supported by the DBMS.

SQL_Dynamic_Cursor_Attributes1

Bitmask that describes the attributes of a dynamic cursor that are supported by the driver (1st subset of attributes.)

SQL_Dynamic_Cursor_Attributes2

Bitmask that diatribes the attributes of a dynamic cursor that are supported by the driver (2nd subset of attributes.)

SQL_Expressions_In_Orderby

Support for expressions in order by clause.

SQL_Fetch_Direction

Bitmask enumerating supported options.

SQL_File_Usage

Files treated in data source.

SQL_Forward_Only_Cursor_Attributes1

A bitmask that describes the attributes of a forward-only cursor that are supported by the driver (1st subset of attributes.)

SQL_Forward_Only_Cursor_Attributes2

A bitmask that describes the attributes of a forward-only cursor that are supported by the driver (2nd subset of attributes.)

SQL_Getdata_Extensions

Bitmask enumerating extensions to SQLGetData.

SQL_Group_By

Bitmask indicating the relationship between GROUP BY columns supported in the DBMS.

SQL_Identifier_Case

Defines whether identifiers are case sensitive.

SQL_Identifier_Quote_Char

Character used to delimit quoted identifiers.

SQL_Keywords

See the Microsoft ODBC 3.5 Programmer’s Reference and SDK Guide for information.

SQL_Like_Escape_Clause

Support of “%” character and “_” character as escape characters in like clause.

SQL_Lock_Types

Bitmask enumerating supported lock types.

Table 12-7 lists SQL options M through Z for sp_sqlgetinfo.

Table 12-7: SQL options for sp_sqlgetinfo (M through Z)

SQL option

Description

SQL_Max_Binary_Literal_Len

Maximum length of binary literal is either unknown or unlimited.

SQL_Max_Char_Literal_Len

Maximum length of character literal is either unknown or unlimited.

SQL_Max_Column_Name_Len

Maximum length for a column name. Convert this string to an integer. A value of 0 means not supported.

SQL_Max_Columns_In_Group_By

Maximum number of columns allowed in a SQL GROUP BY clause. Convert this string to an integer. A value of 0 means that the limit is unknown or unlimited.

SQL_Max_Columns_In_Index

Maximum number of columns allowed in a SQL CREATE INDEX. Convert this string to an integer. A value of 0 means that the limit is unknown.

SQL_Max_Columns_In_Order_By

Maximum number of columns allowed in a SQL ORDER BY clause. Convert this string to an integer. A value of 0 means that the limit is unknown.

SQL_Max_Columns_In_Select

Maximum number of columns allowed in a SQL SELECT column list. Convert this string to an integer. A value of 0 means that the limit is unknown.

SQL_Max_Columns_In_Table

Maximum number of columns allowed in a SQL CREATE TABLEE. Convert this string to an integer. A value of 0 means that the limit is unknown.

SQL_Max_Cursor_Name_Len

Maximum length for a cursor name. Convert this string to an integer. A value of 0 means not supported.

SQL_Max_Index_Size

Maximum number of characters allowed in the combined column length of an index. Convert this string to an integer. A value of 0 indicates that the limit is unknown.

SQL_Max_Identifier_Len

Maximum size in characters that the data source supports for user-defined names.

SQL_Max_Owner_Name_Len

Maximum length for an owner name. Convert this string to an integer. A value of 0 means not supported.

SQL_Max_Procedure_Name_Len

Maximum length for a procedure name. Convert this string to an integer. A value of 0 means not supported.

SQL_Max_Qualifier_Name_Len

Maximum length for a qualifier name. Convert this string to an integer. A value of 0 means not supported.

SQL_Max_Row_Size

Maximum number of characters allowed in the combined column length of a row in a table. Convert this string to an integer. A value of 0 means that the limit is unknown.

SQL_Max_Row_Size_Includes_Long

Includes the length of all long datatypes.

SQL_Max_Statement_Len

Maximum length allowed for a SQL statement. Convert this string to an integer. A value of 0 means that the limit is unknown.

SQL_Max_Table_Name_Len

Maximum length allowed for a table name. Convert this string to an integer. A value of 0 means not supported.

SQL_Max_Tables_In_Select

Maximum number of columns allowed in a SQL SELECT FROM clause. Convert this string to an integer. A value of 0 means that the limit is unknown.

SQL_Max_User_Name_Len

Maximum length for the user name. Convert this string to an integer. A value of 0 means not supported.

SQL_Mult_Result_Sets

Driver does not support multiple result sets in a given language event.

SQL_Multiple_Active_TXN

Only one connection can have an active transaction.

SQL_Need_Long_Data_Len

Need the length of the long datatypes.

SQL_Non_Nullable_Columns

Bitmask indicating whether the DBMS supports non-nullable columns.

SQL_Null_Collation

Bitmask indicating how the DBMS collates NULL values.

SQL_Numeric_Functions

Bitmask indicating the supported scalar numeric functions.

SQL_ODBC_API_Conformance

Bitmask enumerating ODBC level.

SQL_ODBC_SAG_CLI_Conformance

Bitmask enumerating compliance to functions of the SAG specification.

SQL_ODBC_SQL_Conformance

Bitmask indicating supported SQL grammar.

SQL_ODBC_SQL_Opt_IEF

Support for Integrity Enhancement Facility (IEF).

SQL_Order_By_Columns_In_Select

Columns in ORDER BY clause must be in select list.

SQL_OJ_Capabilities

A bitmask enumerating the types of outer joins supported by the driver and data source.

SQL_Outer_Joins

Support for outer joins.

SQL_Owner_Term

The DBMS term for an owner name. A maximum of 30 characters is returned. A null value means not supported.

SQL_Owner_Usage

Bitmask indicating statements in which owners can be used.

SQL_Pos_Operations

Bitmask enumerating the operations in SQLSetPos.

SQL_Positioned_Statements

Bitmask indicating supported positioned SQL statements.

SQL_Procedure_Term

DBMS term for a procedure name. A maximum of 30 characters is returned. A null value means not supported.

SQL_Procedures

Support for procedures.

SQL_Qualifier_Location

Bitmask indicating the position of the qualifier in a qualified table name.

SQL_Qualifier_Name_Separator

Character or string separator between the qualifier and the name element. A maximum of five characters is returned.

SQL_Qualifier_Term

DBMS term for a qualifier name. A maximum of 30 characters is returned.

SQL_Qualifier_Usage

Bitmask indicating in which statements a qualifier can be used.

SQL_Quoted_Identifier_Case

Bitmask describing SQL identifier case and storage in system tables when used in SQL statements.

SQL_Row_Updates

See the Microsoft ODBC 3.5 Programmer’s Reference and SDK Guide for information.

SQL_Scroll_Concurrency

Bitmask identifying concurrency control options for scrollable cursors.

SQL_Scroll_Options

Bitmask indicating scroll options for scrollable cursors.

SQL_Search_Pattern_Escape

See the Microsoft ODBC 3.5 Programmer’s Reference and SDK Guide for information.

SQL_Set_Database_Context

Sybase/Intersolv extension for supporting CSPs. If value = Y, the driver issues use_database_name to the configured database name and is sensitive to three-part names.

SQL_Special_Characters

Special characters used in object names. All characters except a-z, A-Z, 0-9, and the underscore character.

SQL_SQL_Conformance

A value indicating the level of SQL-92 supported by the driver.

SQL_String_Functions

Bitmask indicating supported scalar string functions.

SQL_Subqueries

Bitmask indicating predicates that support subqueries.

SQL_System_Functions

Bitmask indicating supported scalar system functions.

SQL_Table_Term

DBMS term for a table name. A maximum of 30 characters is returned.

SQL_TimeDate_Add_Intervals

Bitmask indicating supported timestamp intervals associated with TIMESTAMPADD function.

SQL_TimeDate_Diff_Intervals

Bitmask indicating supported timestamp intervals associated with TIMESTAMPDIFF function.

SQL_TimeDate_Functions

Bitmask indicating supported timestamp intervals.

SQL_TXN_Capable

Indicates the transaction support in the DBMS.

SQL_TXN_Isolation_Option

Bitmask indicating transaction isolation levels.

SQL_Union

Bitmask indicating support for union clause.

SQL_User_Name

Current user name. A maximum of SQL_Max_User_Name_Len characters are returned. A null value means not supported.