Export From Teradata Table to CSV

南楼画角 提交于 2019-12-05 01:33:21

问题


Is it possible to transfer the date from the Teradata Table into .csv file directly. Problem is - my table has more that 18 million rows. If yes, please send tell me the process


回答1:


For a table that size I would suggest using the FastExport utility. It does not natively support a CSV export but you can mimic the behavior.

Teradata SQL Assistant will export to a CSV but it would not be appropriate to use with a table of that size.

BTEQ is another alternative that may be acceptable for a one-time dump if the table.

Do you have access to any of these?




回答2:


I use the following code to export data from the Teradata Table into .csv file directly.

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



回答3:


You can use FastExport utility from Teradata Studio for exporting the table in CSV format. You can define the delimiter as well.




回答4:


Very simple.

Basic idea would be to export first table as a TXT file and then converting TXT t o CSV using R...read.table ()---> write.csv().....

Below are the steps of exporting TD table as txt file:

  • Select export option from file

  • Select all records from the table you want to export

  • Save it as a TXT file

Then use R to convert TXT file to CSV (set working directory to the location where you have saved your big TXT file):

my_table<-read.table("File_name.txt", fill = TRUE, header = TRUE)
write.csv(my_table,file = "File_name.csv")

This had worked for 15 million records table. Hope it helps.



来源:https://stackoverflow.com/questions/14521892/export-from-teradata-table-to-csv

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!