Export from Teradata table to CSV
For a table of this size, I would suggest using the FastExport utility. It doesn't support CSV export, but you can simulate the behavior.
Teradata SQL Assistant will export to CSV, but it would be impractical to use it with a table of this size.
BTEQ is another alternative that may be acceptable for a one-time dump if the.
Do you have access to any of them?
source to share
I am using the following code to directly export data from Teradata table to .csv
.
CREATE EXTERNAL TABLE
database_name.table_name (to be created) SAMEAS database_name.table_name (already existing, whose data is to be exported)
USING (DATAOBJECT ('C:\Data\file_name.csv')
DELIMITER '|' REMOTESOURCE 'ODBC');
source to share
Very simple.
The basic idea would be to export the first table to a TXT file and then convert TXT to CSV using R ... read.table () ---> write.csv () .....
Following are the steps to export TD table as txt file:
- Select the option to export from file
- Select all records from the table you want to export.
- Save it as TXT file
Then use R to convert the TXT file to CSV (set the working directory to the location where you saved the large TXT file):
my_table<-read.table("File_name.txt", fill = TRUE, header = TRUE)
write.csv(my_table,file = "File_name.csv")
This worked for 15 million records. Hope it helps.
source to share