exportJDBC(data, table, appendToTable = TRUE, driverClass, con, user, password, keepAlive = FALSE, preserveColumnCase = FALSE)
data.frame
or
bdFrame
to export.
TRUE
(the default), rows are appended to the existing table; otherwise, any existing table is dropped and an
empty table is created prior to exporting the data.
TRUE
, keeps the database connection alive after executing the query. The default is
FALSE
.
TRUE
, preserves case-sensitive column names, if supported by database.
If
FALSE
(the default), column name case is converted to the database-specific default.
Exports data to the database using the JDBC driver specified in
driverClass
. The necessary JDBC driver must be
loaded in
sjdbc
before use. See
for details.
Database connections are closed by default after the query executes, unless
keepAlive
is set to
TRUE
. If
keepAlive = TRUE
,
the connection remains open, and successive database commands can reuse the open connection if and only if the same values
for
driverClass
,
con
,
user
, and
password
are supplied.
Some arguments can also be set using .
When exporting to a new table (
appendToTable=FALSE
), column types of the resulting table may not be as desired. Columns containing
text data will be of type
VARCHAR(255)
(or database equivalent), and numeric and timeDate columns will attempt to use appropriate
database-specific column types. If you desire a specific column type or precision in your tables, you should create the table manually using
and then append your data to the existing table.
## Not run: exportJDBC(data=fuel.frame, driverClass="com.microsoft.sqlserver.jdbc.SQLServerDriver", con="jdbc:sqlserver://qadb-s2k:1433;databaseName=testdb;user=testqa;password=testqa;", user="testqa", password="testqa", table="TEST1", append=F) ## End(Not run)