EVOLUTION-MANAGER
Edit File: dbGetRowsAffected.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: The number of rows affected</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 dbGetRowsAffected {DBI}"><tr><td>dbGetRowsAffected {DBI}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>The number of rows affected</h2> <h3>Description</h3> <p>This method returns the number of rows that were added, deleted, or updated by a data manipulation statement. </p> <h3>Usage</h3> <pre> dbGetRowsAffected(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>dbGetRowsAffected()</code> returns a scalar number (integer or numeric), the number of rows affected by a data manipulation statement issued with <code><a href="dbSendStatement.html">dbSendStatement()</a></code>. The value is available directly after the call and does not change after calling <code><a href="dbFetch.html">dbFetch()</a></code>. For queries issued with <code><a href="dbSendQuery.html">dbSendQuery()</a></code>, zero is returned before and after the call to <code>dbFetch()</code>. Attempting to get the rows affected for a result set cleared with <code><a href="dbClearResult.html">dbClearResult()</a></code> gives an error. </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="dbGetStatement.html">dbGetStatement</a>()</code>, <code><a href="dbHasCompleted.html">dbHasCompleted</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 <- dbSendStatement(con, "DELETE FROM mtcars") dbGetRowsAffected(rs) nrow(mtcars) 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>