EVOLUTION-MANAGER
Edit File: dbUnquoteIdentifier.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: Unquote identifiers</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 dbUnquoteIdentifier {DBI}"><tr><td>dbUnquoteIdentifier {DBI}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Unquote identifiers</h2> <h3>Description</h3> <p>Call this method to convert a <a href="SQL.html">SQL</a> object created by <code><a href="dbQuoteIdentifier.html">dbQuoteIdentifier()</a></code> back to a list of <a href="Id.html">Id</a> objects. </p> <h3>Usage</h3> <pre> dbUnquoteIdentifier(conn, x, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>conn</code></td> <td> <p>A <a href="DBIConnection-class.html">DBIConnection</a> object, as returned by <code><a href="dbConnect.html">dbConnect()</a></code>.</p> </td></tr> <tr valign="top"><td><code>x</code></td> <td> <p>An <a href="SQL.html">SQL</a> or <a href="Id.html">Id</a> object.</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>dbUnquoteIdentifier()</code> returns a list of objects of the same length as the input. For an empty character vector this function returns a length-0 object. The names of the input argument are preserved in the output. When passing the first element of a returned object again to <code>dbUnquoteIdentifier()</code> as <code>x</code> argument, it is returned unchanged (but wrapped in a list). Passing objects of class <a href="Id.html">Id</a> should also return them unchanged (but wrapped in a list). (For backends it may be most convenient to return <a href="Id.html">Id</a> objects to achieve this behavior, but this is not required.) </p> <p>An error is raised if plain character vectors are passed as the <code>x</code> argument. </p> <h3>Specification</h3> <p>For any character vector of length one, quoting (with <code><a href="dbQuoteIdentifier.html">dbQuoteIdentifier()</a></code>) then unquoting then quoting the first element is identical to just quoting. This is also true for strings that contain special characters such as a space, a dot, a comma, or quotes used to mark strings or identifiers, if the database supports this. </p> <p>Unquoting simple strings (consisting of only letters) wrapped with <code><a href="SQL.html">SQL()</a></code> and then quoting via <code><a href="dbQuoteIdentifier.html">dbQuoteIdentifier()</a></code> gives the same result as just quoting the string. Similarly, unquoting expressions of the form <code>SQL("schema.table")</code> and then quoting gives the same result as quoting the identifier constructed by <code>Id(schema = "schema", table = "table")</code>. </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="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> </p> <h3>Examples</h3> <pre> # Unquoting allows to understand the structure of a # possibly complex quoted identifier dbUnquoteIdentifier( ANSI(), SQL(c('"Catalog"."Schema"."Table"', '"Schema"."Table"', '"UnqualifiedTable"')) ) # The returned object is always a list, # also for Id objects dbUnquoteIdentifier( ANSI(), Id(catalog = "Catalog", schema = "Schema", table = "Table") ) # Quoting is the inverse operation to unquoting the elements # of the returned list dbQuoteIdentifier( ANSI(), dbUnquoteIdentifier(ANSI(), SQL("UnqualifiedTable"))[[1]] ) dbQuoteIdentifier( ANSI(), dbUnquoteIdentifier(ANSI(), Id(schema = "Schema", table = "Table"))[[1]] ) </pre> <hr /><div style="text-align: center;">[Package <em>DBI</em> version 1.1.0 <a href="00Index.html">Index</a>]</div> </body></html>