SQLBrowseConnect - ODBC Driver for Teradata

ODBC Driver for Teradata User Guide

Product
ODBC Driver for Teradata
Release Number
16.10
Published
May 2017
Language
English (United States)
Last Update
2018-07-11
dita:mapPath
smj1488824663219.ditamap
dita:ditavalPath
Audience_PDF_product_legacy_odbc_include.ditaval
dita:id
B035-2526
lifecycle
previous
Product Category
Teradata Tools and Utilities

SQLBrowseConnect is similar to SQLDriverConnect, but allows the caller to provide the connection information in iterations. SQLBrowseConnect does not allow the driver to prompt for additional logon information. Instead, the driver returns a string indicating what information is required and what information might be optionally specified.

If, for example, the user specifies:

DRIVER=Teradata

then the ODBC driver might return the following string:

"DBCNAME:Teradata System=?;UID:Teradata User Id=?;PWD:Teradata
Password=?;*USEINTEGRATEDSECURITY:Enable SSO =
?;*DATABASE:DefaultDatabase=?;*ACCOUNT:Account=?;"

where the * indicates an optional field, and the “?” indicates a missing value.

Syntax

SQLRETURN SQLBrowseConnect(
   SQLHDBC 		       ConnectionHandle,
   SQLCHAR * 	     InConnectionString,
   SQLSMALLINT   	 StringLength1,
   SQLCHAR * 	     OutConnectionString,
   SQLSMALLINT 	   BufferLength,
   SQLSMALLINT * 	 StringLength2Ptr);

SQLBrowseConnect supports an iterative method of discovering and enumerating the attributes and attribute values required to connect to a data source.

Each call to SQLBrowseConnect returns successive levels of attributes and attribute values and the OutConnectionString contains the attributes needed for the next level. When all levels have been enumerated, a connection to the data source is completed and a complete connection string is returned by SQLBrowseConnect.

It uses the connection string keywords related to security and logon.

SQLBrowseConnect establishes an authenticated connection using the authentication mechanism selected.

SQLBrowseConnect returns the following in the OutConnectionString for the connection string attribute keywords:

*AUTHENTICATION:Authentication Mechanism={<MechanismList>}

where the braces are literal (they are returned by the driver) and the <MechanismList> is a comma-separated list of colon-separated pairs of mechanism names and mechanism labels. The asterisk indicates that the AUTHENTICATION attribute is optional.

The mechanism name labels are user-friendly names intended by ODBC to be shown as labels in a dialog box. If such names are available from TeraGSS then they will be used; otherwise, the mechanism names will be used. Default mechanisms will not be indicated.

The mechanisms enumerated in the <MechanismList> are supported on the client if there is not enough information in the connection string to establish a connection to the gateway. Otherwise, the list will contain the authentication mechanisms supported by both the client and gateway.

An example:

*AUTHENTICATION:Authentication Mechanism={TD2:Teradata 2, KRB5:Kerberos}
*AUTHENTICATIONSTRING:Authentication String=?

where the “?” indicates that a value is required.

SQLBrowseConnect returns SQL_ERROR and an error message if no authentication mechanism can be selected.