Importing data from excel using the insert statement
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


Importing data from excel using the insert... Expand / Collapse
Author
Message
Posted 5/22/2006 4:26:20 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 5/23/2006 8:36:00 AM
Posts: 3, Visits: 1
I've created a volatile table and want to import a multiple field list into it from an excel file I have saved as delimited text. I've been succesful with a single field, but not multiple fields. The insert code I've used so far is as follows:
insert into cs.tag_table2 values(?)
I can manually do every row, but there's got to be a better way, right?
Any help is greatly appreciated...
Post #4217
Posted 5/23/2006 8:12:04 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 8/3/2006 2:56:00 PM
Posts: 13, Visits: 1
If you have the file in excel, you can create a column that uses the concatenate function to build your insert statements.

=concatenate("insert into cs.tag_table2 (field1, field2) values (",A1,",",B1,");"

Paste that down a column for each row. Then copy and paste the insert statements into queryman and run it like a script.

It's not exactly what you are asking for, but it's a quick trick to insert excel data into any database.
Post #4218
Posted 5/23/2006 8:38:34 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 5/23/2006 8:36:00 AM
Posts: 3, Visits: 1
Thanks for the help, that'll work! I'm still interested if anyone has a way to do it with one statement...
Post #4219
Posted 5/23/2006 12:03:37 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 8/17/2006 4:25:00 AM
Posts: 3, Visits: 1
Looking at this differently.

Try linking the excel spreadsheet to an access database. Link to your target table in teradata using ODBC.

Then create a insert data query in the query.

Its messy and not really a recommended way of doing it but it will work.


Simon Chandler

EDW Database Administrator

Post #4223
Posted 5/24/2006 4:22:36 AM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 7/22/2008 3:48:36 AM
Posts: 173, Visits: 5
The most common and used way of loading data to Teradata from a flat-file is through the load utilities.
You could write a Fastload or Multiload script and load the CSV formatted file with that.
Post #4227
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 2:32am

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.063. 8 queries. Compression Disabled.