EVOLUTION-MANAGER
Edit File: dbColumnInfo.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: Information about result types</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 dbColumnInfo {DBI}"><tr><td>dbColumnInfo {DBI}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Information about result types</h2> <h3>Description</h3> <p>Produces a data.frame that describes the output of a query. The data.frame should have as many rows as there are output fields in the result set, and each column in the data.frame describes an aspect of the result set field (field name, type, etc.) </p> <h3>Usage</h3> <pre> dbColumnInfo(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>dbColumnInfo()</code> returns a data frame with at least two columns <code>"name"</code> and <code>"type"</code> (in that order) (and optional columns that start with a dot). The <code>"name"</code> and <code>"type"</code> columns contain the names and types of the R columns of the data frame that is returned from <code><a href="dbFetch.html">dbFetch()</a></code>. The <code>"type"</code> column is of type <code>character</code> and only for information. Do not compute on the <code>"type"</code> column, instead use <code>dbFetch(res, n = 0)</code> to create a zero-row data frame initialized with the correct data types. </p> <p>An attempt to query columns for a closed result set raises an error. </p> <h3>Specification</h3> <p>A column named <code>row_names</code> is treated like any other column. </p> <p>The column names are always consistent with the data returned by <code>dbFetch()</code>. If the query returns unnamed columns, unique non-empty and non-<code>NA</code> names are assigned. In the case of a duplicate column name, the first occurrence retains the original name, and unique names are assigned for the other occurrences. Column names that correspond to SQL or R keywords are left unchanged. </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="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="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:") rs <- dbSendQuery(con, "SELECT 1 AS a, 2 AS b") dbColumnInfo(rs) dbFetch(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>