ODBC call SQL_CATALOG_NAME is not supported by Teradata

Database

ODBC call SQL_CATALOG_NAME is not supported by Teradata

I connect to the Teradata database using ODBC. My code checks for the catalog support by using SQL_CATALOG_NAME API call. But this call fails for Teradata.

All other databases like Oracle,MySQL,SQLServer succeed for this call. They either return 'Y' or 'N' but Teradata alone fails.

Below is my code

tc->h->iRC = SQLGetInfo(tc->h->hDbc,
SQL_CATALOG_NAME,
(SQLPOINTER)catalogSupport,
sizeof(catalogSupport),
NULL);

if ( !checkSql(tc->h) ) {
*catalogSupport = 'N';
errorMessage = reportError(__FILE__,__LINE__,"getCatalogSupport-SQL_Catalog_Support",tc);
cleanupSql(tc);
return false;
}
return true;

But when i set the ODBC version to 3.0 using the below code it works fine

h->iRC = SQLSetEnvAttr(h->hEnv, SQL_ATTR_ODBC_VERSION, (void *) SQL_OV_ODBC3, 0);
if ( !checkSql(h) ) {
errorMessage = reportError(__FILE__,__LINE__,"SQLSetEnvAttr",tc);
return false;
}

I know that SQL_CATALOG_NAME is ODBC 3.0 version call. But none of the other databases except Teradata requires the above set of code to make SQL_CATALOG_NAME call successful.

Let me know whats going wrong here??
1 REPLY
Teradata Employee

Re: ODBC call SQL_CATALOG_NAME is not supported by Teradata


so who is doing wrong here, Teradata driver or other drivers?

As you said, Teradata driver returned error if application is ODBC 2.x and when requested a 3.x info type.