Learn R Programming

RMySQL (version 0.4-6)

isSQLKeyword: Is a name an SQL keyword?

Description

Verify whether a character vector contains SQL keywords

Usage

isSQLKeyword(x, keywords=.SQLKeywords, case=c("lower", "upper", "any")[3])

Arguments

x
character vector of potential SQL identifiers.
keywords
a character vector with SQL keywords. By default it's .SQLKeywords, supplied in the RS-DBI S chapter or R package.
case
a character string specifying whether to make the comparison as lower case, upper case, or any of the two. it defaults to any.

Value

  • a logical vector specifying whether the corresponding entry is or is not an SQL keyword.

References

The set of SQL keywords is stored in the character vector .SQLKeywords and reflects the SQL ANSI/ISO standard as documented in "X/Open SQL and RDA", 1994, ISBN 1-872630-68-8. Users can easily override or update this vector.

See Also

make.SQL.names

Examples

Run this code
oracle.keywords <- c("CLUSTER", "COLUMN", "MINUS", "DBNAME)
isSQLKeyword(nam, c(.SQLKeywords, oracle.keywords))
[1]  T  T  T  F

Run the code above in your browser using DataLab