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

Teradata® Package for R User Guide

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Teradata Package for R
Release Number
17.20
Published
March 2024
ft:locale
en-US
ft:lastEdition
2024-04-09
dita:mapPath
efv1707506846369.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
nqx1518630623256
lifecycle
latest
Product Category
Teradata Vantage

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"))
This 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.