Exemplo n.º 1
0
RETCODE  SQL_API SQLGetInfoW(HDBC ConnectionHandle,
           SQLUSMALLINT InfoType, PTR InfoValue,
           SQLSMALLINT BufferLength, SQLSMALLINT *StringLength)
{
    CSTR func = "SQLGetInfoW";
    ConnectionClass *conn = (ConnectionClass *) ConnectionHandle;
    RETCODE ret;

    ENTER_CONN_CS(conn);
    CC_set_in_unicode_driver(conn);
    CC_clear_error(conn);
#if (ODBCVER >= 0x0300)
    mylog("[%s(30)]", func);
    if ((ret = PGAPI_GetInfo(ConnectionHandle, InfoType, InfoValue,
            BufferLength, StringLength)) == SQL_ERROR)
    {
        if (conn->driver_version >= 0x0300)
        {
            CC_clear_error(conn);
            ret = PGAPI_GetInfo30(ConnectionHandle, InfoType, InfoValue,
                    BufferLength, StringLength);
        }
    }
    if (SQL_ERROR == ret)
        CC_log_error("SQLGetInfoW(30)", "", conn);
#else
    mylog("[%s]", func);
    ret = PGAPI_GetInfo(ConnectionHandle, InfoType, InfoValue,
            BufferLength, StringLength);
    if (SQL_ERROR == ret)
        CC_log_error("SQLGetInfoW", "", conn);
#endif
    LEAVE_CONN_CS(conn);
    return ret;
}
Exemplo n.º 2
0
RETCODE		SQL_API
SQLGetInfo(HDBC ConnectionHandle,
		   SQLUSMALLINT InfoType, PTR InfoValue,
		   SQLSMALLINT BufferLength, SQLSMALLINT *StringLength)
{
	CSTR	func = "SQLGetInfo";
	RETCODE		ret;
	ConnectionClass	*conn = (ConnectionClass *) ConnectionHandle;

	CC_examine_global_transaction(conn);
	ENTER_CONN_CS(conn);
	CC_clear_error(conn);
#if (ODBCVER >= 0x0300)
	mylog("[%s(30)]", func);
	if ((ret = PGAPI_GetInfo(ConnectionHandle, InfoType, InfoValue,
				BufferLength, StringLength)) == SQL_ERROR)
	{
		if (conn->driver_version >= 0x0300)
		{
			CC_clear_error(conn);
			ret = PGAPI_GetInfo30(ConnectionHandle, InfoType, InfoValue,
								   BufferLength, StringLength);
			goto cleanup;
		}
	}
	if (SQL_ERROR == ret)
		CC_log_error("SQLGetInfo(30)", "", conn);
#else
	mylog("[%s]", func);
	if (ret = PGAPI_GetInfo(ConnectionHandle, InfoType, InfoValue,
			BufferLength, StringLength), SQL_ERROR == ret)
		CC_log_error(func, "", conn);
#endif
cleanup:
	LEAVE_CONN_CS(conn);
	return ret;
}
Exemplo n.º 3
0
RETCODE  SQL_API
SQLGetInfoW(HDBC ConnectionHandle,
			SQLUSMALLINT InfoType, PTR InfoValue,
			SQLSMALLINT BufferLength, SQLSMALLINT *StringLength)
{
	CSTR func = "SQLGetInfoW";
	ConnectionClass	*conn = (ConnectionClass *) ConnectionHandle;
	RETCODE	ret;

	CC_examine_global_transaction(conn);
	ENTER_CONN_CS(conn);
	CC_set_in_unicode_driver(conn);
	CC_clear_error(conn);
	mylog("[%s]", func);
	if ((ret = PGAPI_GetInfo(ConnectionHandle, InfoType, InfoValue,
							 BufferLength, StringLength)) == SQL_ERROR)
		CC_log_error("SQLGetInfoW", "", conn);
	LEAVE_CONN_CS(conn);
	return ret;
}