Hello Francine,
Thank you for your response, and looking into this. I tried to import via Studio, and yes, that worked - thanks. But, our goal is to export and import high volumes of files and so the GUI is not workable for this situation. To import, we are using a code generator to generate TPT scripts on the fly, calling TPT to import a delimited file into a staging table of all VARCHAR columns, then finally the code generator invokes a BTEQ insert/select (simplified examples below). The SELECT is failing with either "invalid timestamp" or "invalid format string". I'm a Teradata newbie, and cant seem to find the appropriate format string to account for the trailing .0. Any help would be appreciated. Thanks!
-Greg
INSERT INTO TARGET_TABLE
SELECT
CAST( MyTimeStamp AS TIMESTAMP(0) format 'YYYY-MM-DDBHH:MI:SS.S(1)')
FROM STAGING_TABLE;
INSERT INTO TARGET_TABLE
SELECT
CAST( MyTimeStamp AS TIMESTAMP(0) format 'YYYY-MM-DDBHH:MI:SS.9(1)')
FROM STAGING_TABLE;
INSERT INTO TARGET_TABLE
SELECT
CAST( MyTimeStamp AS TIMESTAMP(0) format 'YYYY-MM-DDBHH:MI:SS')
FROM STAGING_TABLE;
Hello Francine,
Thank you for your response, and looking into this. I tried to import via Studio, and yes, that worked - thanks. But, our goal is to export and import high volumes of files and so the GUI is not workable for this situation. To import, we are using a code generator to generate TPT scripts on the fly, calling TPT to import a delimited file into a staging table of all VARCHAR columns, then finally the code generator invokes a BTEQ insert/select (simplified examples below). The SELECT is failing with either "invalid timestamp" or "invalid format string". I'm a Teradata newbie, and cant seem to find the appropriate format string to account for the trailing .0. Any help would be appreciated. Thanks!
-Greg
INSERT INTO TARGET_TABLE
SELECT
CAST( MyTimeStamp AS TIMESTAMP(0) format 'YYYY-MM-DDBHH:MI:SS.S(1)')
FROM STAGING_TABLE;
INSERT INTO TARGET_TABLE
SELECT
CAST( MyTimeStamp AS TIMESTAMP(0) format 'YYYY-MM-DDBHH:MI:SS.9(1)')
FROM STAGING_TABLE;
INSERT INTO TARGET_TABLE
SELECT
CAST( MyTimeStamp AS TIMESTAMP(0) format 'YYYY-MM-DDBHH:MI:SS')
FROM STAGING_TABLE;