copy_to API When Loading Data into PTI Table | Teradata R Package - 17.00 - copy_to API When Loading Data into PTI Table - Teradata R Package

Teradata® R Package User Guide

prodname
Teradata R Package
vrm_release
17.00
created_date
November 2020
category
User Guide
featnum
B700-4005-090K
When the copy_to API fails with the Database error message “4358 Time Series: TD_TIMECODE| TD_SEQNO out of range for table”, you must check the permitted TD_TIMECODE and TD_SEQNO ranges based on the other arguments of copy_to() using the following:
DBI::dbGetQuery(con, “exec DBC.TD_TIMESERIES_RANGE('TDAPUSERDB.<table_name>')”)
Where:
  • con is the connection object;
  • TDAPUSERDB is the database name;
  • <table_name> is the name of the table to be created.
And correct the data or the arguments like seq.max to suit the data.
When the data insertion fails, the table is already created.

The failed copy_to() creates the table but fails to load the data. So, if the table is to be created with the same table name, the table has to be dropped by setting the argument overwrite to "TRUE".