| make.SQL.names {RSQLite} | R Documentation |
Produce legal SQL identifiers from an R/S chacter vector.
make.SQL.names(snames, unique=T, allow.keywords=T)
snames |
a character vector of R/S identifiers (syntactic names). |
unique |
logical describing whether the resulting set of SQL names should be unique.
Its default is TRUE.
Following the SQL 92 standard, uniqueness of SQL identifiers
is determined regardless of whether letters are upper or lower case.
|
allow.keywords |
logical describing whether SQL keywords should be allowed in the resulting
set of SQL names.
Its default is TRUE
|
The algorithm first invokes
make.names
and then replaces each occurrence of a dot ``.'' by an underscore
``_''.
a character vector with legal SQL identifiers.
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.
The current mapping is not guaranteed to be fully reversible: some
SQL identifiers that get mapped into R/S identifiers with
make.names
and then back to SQL with make.SQL.names
will not be equal to the original SQL indetifiers (e.g., compound
SQL identifiers of the form username.tablename will
loose the dot ``.'').
isSQLKeyword
make.names
getTable
existsTable
assignTable
removeTable
dbConnect
# This example shows how we could export a bunch of data.frames
# into tables on a remote database.
con <- dbConnect("Oracle", user="iptraffic", pass = pwd)
export <- c("trantime.email", "trantime.print", "round.trip.time.email")
tabs <- make.SQL.names(export, unique = T, allow.keywords = T)
for(i in seq(along = export) )
assignTable(con, name = tabs[i], get(export[i]))