Main Content


(To be removed) Get time specified for SQL queries to succeed

The querytimeout function will be removed in a future release. There is no replacement for this functionality. To import data, use the fetch function. For details, see Compatibility Considerations.


timeout = querytimeout(curs)


timeout = querytimeout(curs) returns the amount of time, in seconds, allowed for SQL queries of the open cursor object curs to succeed. If a given query cannot complete in the specified time, the toolbox stops trying to perform the query.

The database administrator defines timeout values. If the timeout value is zero, queries must complete immediately.


Get the current database timeout setting for curs.

ans =

To create a cursor object using an ODBC connection, you can use the native ODBC interface. For details, see database.


  • This error message displays if a given database does not have a database timeout feature:

    [Driver]Optional feature not implemented
  • ODBC drivers for Microsoft® Access™ and Oracle® do not support querytimeout.

Compatibility Considerations

expand all

Warns starting in R2021a

See Also


Introduced before R2006a