Export from Teradata table to CSV

Is it possible to transfer date from Teradata table to .csv file directly. The problem is my table has over 18 million rows. If yes, send me a request

+3


source to share


4 answers


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?

+2


source


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');

      

+1


source


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

enter image description here

  • Select all records from the table you want to export.

enter image description here

  • Save it as TXT file

enter image description here

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.

+1


source


You can use the FastExport utility from Teradata Studio to export the table in CSV format. You can also define a delimiter.

0


source







All Articles