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