EVOLUTION-MANAGER
Edit File: dbHasCompleted.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Completion status</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for dbHasCompleted {DBI}"><tr><td>dbHasCompleted {DBI}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Completion status</h2> <h3>Description</h3> <p>This method returns if the operation has completed. A <code>SELECT</code> query is completed if all rows have been fetched. A data manipulation statement is always completed. </p> <h3>Usage</h3> <pre> dbHasCompleted(res, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>res</code></td> <td> <p>An object inheriting from <a href="DBIResult-class.html">DBIResult</a>.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Other arguments passed on to methods.</p> </td></tr> </table> <h3>Value</h3> <p><code>dbHasCompleted()</code> returns a logical scalar. For a query initiated by <code><a href="dbSendQuery.html">dbSendQuery()</a></code> with non-empty result set, <code>dbHasCompleted()</code> returns <code>FALSE</code> initially and <code>TRUE</code> after calling <code><a href="dbFetch.html">dbFetch()</a></code> without limit. For a query initiated by <code><a href="dbSendStatement.html">dbSendStatement()</a></code>, <code>dbHasCompleted()</code> always returns <code>TRUE</code>. Attempting to query completion status for a result set cleared with <code><a href="dbClearResult.html">dbClearResult()</a></code> gives an error. </p> <h3>Specification</h3> <p>The completion status for a query is only guaranteed to be set to <code>FALSE</code> after attempting to fetch past the end of the entire result. Therefore, for a query with an empty result set, the initial return value is unspecified, but the result value is <code>TRUE</code> after trying to fetch only one row. Similarly, for a query with a result set of length n, the return value is unspecified after fetching n rows, but the result value is <code>TRUE</code> after trying to fetch only one more row. </p> <h3>See Also</h3> <p>Other DBIResult generics: <code><a href="DBIResult-class.html">DBIResult-class</a></code>, <code><a href="dbBind.html">dbBind</a>()</code>, <code><a href="dbClearResult.html">dbClearResult</a>()</code>, <code><a href="dbColumnInfo.html">dbColumnInfo</a>()</code>, <code><a href="dbFetch.html">dbFetch</a>()</code>, <code><a href="dbGetInfo.html">dbGetInfo</a>()</code>, <code><a href="dbGetRowCount.html">dbGetRowCount</a>()</code>, <code><a href="dbGetRowsAffected.html">dbGetRowsAffected</a>()</code>, <code><a href="dbGetStatement.html">dbGetStatement</a>()</code>, <code><a href="dbIsReadOnly.html">dbIsReadOnly</a>()</code>, <code><a href="dbIsValid.html">dbIsValid</a>()</code>, <code><a href="dbQuoteIdentifier.html">dbQuoteIdentifier</a>()</code>, <code><a href="dbQuoteLiteral.html">dbQuoteLiteral</a>()</code>, <code><a href="dbQuoteString.html">dbQuoteString</a>()</code>, <code><a href="dbUnquoteIdentifier.html">dbUnquoteIdentifier</a>()</code> </p> <h3>Examples</h3> <pre> con <- dbConnect(RSQLite::SQLite(), ":memory:") dbWriteTable(con, "mtcars", mtcars) rs <- dbSendQuery(con, "SELECT * FROM mtcars") dbHasCompleted(rs) ret1 <- dbFetch(rs, 10) dbHasCompleted(rs) ret2 <- dbFetch(rs) dbHasCompleted(rs) dbClearResult(rs) dbDisconnect(con) </pre> <hr /><div style="text-align: center;">[Package <em>DBI</em> version 1.1.0 <a href="00Index.html">Index</a>]</div> </body></html>