SQLRETURN SQLGetInfo( SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValuePtr, SQLSMALLINT BufferLength, SQLSMALLINT * StringLengthPtr);
SQLGetInfo returns general information about the driver and data source associated with a connection. The information types are described in the SQLGetInfo topic of the ODBC API Reference section in the ODBC Programmer's Reference.
There is an InfoType, which returns the username of the current database user:
|SQLGetInfo Info Type||Value Returned|
|SQL_USER_NAME||A character string with the name used in a particular database, which can be different from the login name.|
Previously, the username provided to ODBC (either explicitly or implicitly through SSO) was identical to the Teradata Database username, but with the LDAP authentication mechanism it is possible to map the mechanism username to a different Teradata Database username.