tdUpload: tdUpload

Description Usage Arguments Details Value See Also

Description

Uploads data to Teradata tables. Can take a JDBC connection object (conn) if provided. If no JDBC connection is provided, then a connection is attempted using the user, and password provided. If none is provided, then tries to locate a connection object (conn) in the global environment.

If a connection profile (e.g. username, password, etc.) is provided, then an attempt is made to connect to Teradata. Once the query is run, the connection is then closed. If a connection object (conn) is provided to the function (or one is found globally), then the connection remains open.

Usage

1
2
tdUpload(data = NULL, table = NULL, batchSize = 2500, verbose = TRUE,
  checkTable = TRUE, ...)

Arguments

data

link{data.frame} containing data to upload. This must be in the same column order as the Teradata table.

table

Name of the Teradata table to upload data to.

batchSize

Number of rows to upload simultaneously.

verbose

logical. If TRUE, then print progress after each batch is uploaded.

checkTable

logical. If TRUE, then assumed that table already exists. If FALSE, then check whether table exists. Used internally with tdCreate function to cut down on processing time.

...

Optional connection settings.

Details

By default, numeric vectors will be uploaded as an int, while character vectors will be uploaded as a varchar with the longest character length. For now, if any other class is included, an error will be thrown.

In order to keep the required Java memory down, data is uploaded in batches at a time. This can be configured to be as many (or little observations) as desired. If any of the batched observations have bad values, then all observations corresponding with that batch will fail to load. It might help in this situation to reduce the batch size to pinpoint which observation(s) is(are) causing the issue.

Value

Returns an invisible objecting containing the count of the number of rows uploaded.

See Also

tdConn for connection, tdNames for table names, td for general queries, tdCpu for CPU usage, and tdJoin for joining tables.


tranlm/tdR documentation built on May 31, 2019, 7:45 p.m.