dbQuoteString-DatabaseConnectorConnection-character-method: Quote literal strings

Description Usage Arguments Value See Also


Call this method to generate a string that is suitable for use in a query as a string literal, to make sure that you generate valid SQL and protect against SQL injection attacks.



## S4 method for signature 'DatabaseConnectorConnection,character'
dbQuoteString(conn, x, ...)



A DBIConnection object, as returned by dbConnect().


A character vector to quote as string.


Other arguments passed on to methods.


dbQuoteString() returns an object that can be coerced to character, of the same length as the input. For an empty character vector this function returns a length-0 object.

When passing the returned object again to dbQuoteString() as x argument, it is returned unchanged. Passing objects of class SQL should also return them unchanged. (For backends it may be most convenient to return SQL objects to achieve this behavior, but this is not required.)

See Also

Other DBIResult generics: DBIResult-class, dbBind(), dbClearResult(), dbColumnInfo(), dbFetch(), dbGetInfo(), dbGetRowCount(), dbGetRowsAffected(), dbGetStatement(), dbHasCompleted(), dbIsReadOnly(), dbIsValid(), dbQuoteIdentifier(), dbQuoteLiteral(), dbUnquoteIdentifier()

DatabaseConnector documentation built on Nov. 18, 2021, 5:08 p.m.