[unixODBC-support] Query timeout

Martin Evans martin.evans at easysoft.com
Thu Mar 22 09:07:47 GMT 2007


Chen, Kangfu wrote:
> I'm connecting to Sybase 12.5 from Linux suse9 using unixODBC-2.2.12 and the Sybase ODBC driver. 
> 
>  
> 
> I have a timeout problem: 
> 
>  
> 
> I set the query timeout as 3 seconds by SQLSetStmtAttr(SQL_ATTR_QUERY_TIMEOUT), but if call SQLExecDirect() or SQLPrepare()/SQLExecute() timeout, the return code is still SQL_SUCCESS. 
> 
>  
> 
> How can I distinguish a timeout error and a successful return?
> 
>  
> 
> Thanks

Not all drivers support query timeout - check yours is.
Assuming Sybase supports query timeout (and I'd guess it does if setting 
it does halt long running queries) SQLExecute/SQLExecDirect should 
return an SQL_ERROR and HYT00 - Timeout Expired. If it doesn't I'd 
suggest it is broken.

Martin
-- 
Martin J. Evans
Easysoft Limited
http://www.easysoft.com



More information about the unixODBC-support mailing list