[unixODBC-dev] SQLSetConnectOption() call returns SQL_SUCCESS despite returning S1009/HY024(invalid argument value)

G, Hemanth Kumar Hemanth.G at Teradata.com
Fri May 22 09:44:53 BST 2009


Hi,

      I am using unixODBC DM on Z/Linux 32-bit OS to connect to Teradata
database.
I observe SQLSetConnectOption() call with an invalid attribute value
returning SQL_SUCCESS, instead of returning HY024(Invalid attribute
value).

Call:
rc = SQLSetConnectOption(hdbc, SQL_ATTR_ACCESS_MODE, 2);   //where 2 is
an invalid attribute with SQL_ATTR_ACCESS_MODE
Trace :
------------------------------------------------------------------------
----
[ODBC][5626][1242980780.187680][SQLSetConnectOption.c][262]
                Entry:
                        Connection = 0x403810
                        Option = SQL_ATTR_ACCESS_MODE
                        Value = 2
[ODBC][5626][1242980780.187700][SQLSetConnectOption.c][405]
                Exit:[SQL_SUCCESS]
------------------------------------------------------------------------
----

This is what is mentioned in ODBC specifications for SQLSetConnectAttr:
------------------------------------------------------------------------
----
HY024 (Invalid attribute value)
Given the specified Attribute value, an invalid value was specified in
ValuePtr. (The Driver Manager returns this SQLSTATE only for connection
and statement attributes that accept a discrete set of values, such as
SQL_ATTR_ACCESS_MODE or SQL_ATTR_ASYNC_ENABLE. For all other connection
and statement attributes, the driver must verify the value specified in
ValuePtr.) 
------------------------------------------------------------------------
----

Can you verify this once?

Thanks
Hemanth.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-dev/attachments/20090522/bb4b1bd2/attachment.html>


More information about the unixODBC-dev mailing list