问题
Hi everybody,
someone here may help me on that? I have to load data from a csv file into a table but I have no idea how.
There are about 12 million records into the csv file.
thanks
回答1:
I have loaded data into Teradata using the IMPORT function available in the TERADATA SQL Assistant.
But handling this amount of data I am not sure whether the method I explain you below will be efficient enough.
However, you may try something like the below:
If you are using TERADATA SQL Assistant:
- Goto FILE menu-> click IMPORT option
- You should have a table ready with all the required columns in your CSV file and correct datatype.
- In SQL Assistant, write the below query:
INSERT INTO TABLE_NAME VALUES(?,?,?,?....);
- Once you execute the above query TERADATA will ask for the file from which you want to import the data, you just need to browse and select your file and the import will begin.
P.S: Since you have 12 m records, it will definitely take lot of time.
回答2:
SQL assistant is not the way to load a file with that kind of volume. Either use fload if loading an empty table otherwise use mload.
回答3:
What kind of table are you going to load data? (empty or containing data)
If you are going to load data in a staging table (empty table) then Fastload is the best and quickest method to load data in Teradata.
If table already has data then you can use Multiload (mload) to load data.
If you share your table DDL then it would easier to build Fastload or Multiload script for loading data.
来源:https://stackoverflow.com/questions/31730700/how-to-load-data-from-a-csv-file-into-a-table-using-teradata-studio