Learn R Programming

RODBCext (version 0.3.2)

odbcSetQueryTimeout: Sets the query timeout of a prepared query

Description

A query has to be already prepared using SQLPrepare()

Throws an error if any error occured

Usage

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,

See Also

odbcGetQueryTimeout, odbcConnect, odbcDriverConnect

Examples

Run this code
# 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)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab