sqlLike: Create a Series of SQL LIKE Statements

Description Usage Arguments Examples

View source: R/sqlLike.R

Description

This function allows you to take a vector and turn it into a character string containing a series of LIKE statements for use in an SQL query.

Usage

1
sqlLike(vect, field, wildcard = "%", loc = "end")

Arguments

vect

A vector you want to use for creating your LIKE statements

field

The name of the field in your SQL database to use in your LIKE statements

wildcard

Which wildcard character you would like to use in your LIKE statements. Defaults to the percent sign

loc

Where you would like to locate the wildcard character for each value. Current options are "end" for the appending the wildcard to the end of the value, "lead" for appending the wildcard to the beginning of the value, and "both" for both. Defaults to "end".

Examples

1
2
sqlLike(iris$Species, field = "iris_species")
sqlLike(iris$Species, field = "iris_species", wildcard = "_", loc = "both")

spenceredwin/sqlWriteR documentation built on Sept. 13, 2019, 1:36 p.m.