odbcSetQueryTimeout: Sets the query timeout of a prepared query

Description Usage Arguments Value Note See Also Examples

View source: R/odbcSetQueryTimeout.R

Description

A query has to be already prepared using SQLPrepare()

Throws an error if any error occured

Usage

1
odbcSetQueryTimeout(channel, timeout = 0)

Arguments

channel

an open RODBC channel (connection)

timeout

the new query timeout value in seconds (0 means "no timeout")

Value

0 = success, 1 = success but with an info message,

Note

Not all drivers will support a query timeout. You may get an error then or the query timeout values remains unchanged silently.

See Also

odbcGetQueryTimeout, odbcConnect, odbcDriverConnect

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
  conn = odbcConnect('MyDataSource')
  
  sqlPrepare(conn, "SELECT * FROM myTable WHERE column = ?")
  odbcSetQueryTimeout(conn, 120)   # sets the query timeout of the prepared statement
  sqlExecute(conn, 'myValue')
  sqlFetchMore(conn)

## End(Not run)

RODBCext documentation built on Feb. 6, 2020, 5:10 p.m.