Accessing Table in Non-Default Database in Vantage | Teradata Package for R - 16.20 - Accessing Table in Non-Default Database in Teradata Vantage - Teradata R Package

Teradata® R Package User Guide

Product
Teradata R Package
Release Number
16.20
Published
February 2020
Language
English (United States)
Last Update
2022-05-02
dita:mapPath
qbt1519078127352.ditamap
dita:ditavalPath
Generic_no_ie_no_tempfilter.ditaval

When you create a connection to Vantage, you have the option to either specify a default database, or rely on the default database of the Teradata user. However, it is also possible to interact with tables in a database other than the default by using the in_schema() function of the dbplyr package.

To interact with a database other than the default, your connection user account must have appropriate permissions on the target database granted by the database administrator.

Example

Assume that as user "tdapUser", you want to create a table "iris_flowers" in the user database "tdapUser", while your default database is "tdapUserDB".

copy_to(con, iris, in_schema("tdapUser", "iris_flowers"))
The above syntax must be observed to interact successfully with a non-default database. Using copy_to(con, iris, "tdapUser.iris_flowers") is wrong syntax and the statement does not work.