Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Teradata Cookbook

You're reading from   Teradata Cookbook Over 85 recipes to implement efficient data warehousing solutions

Arrow left icon
Product type Paperback
Published in Feb 2018
Publisher Packt
ISBN-13 9781787280786
Length 454 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (3):
Arrow left icon
Abhinav Khandelwal Abhinav Khandelwal
Author Profile Icon Abhinav Khandelwal
Abhinav Khandelwal
Viswanath Kasi Viswanath Kasi
Author Profile Icon Viswanath Kasi
Viswanath Kasi
Rajsekhar Bhamidipati Rajsekhar Bhamidipati
Author Profile Icon Rajsekhar Bhamidipati
Rajsekhar Bhamidipati
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Installation 2. SQLs FREE CHAPTER 3. Advanced SQL with Backup and Restore 4. All about Indexes 5. Mixing Strategies – Joining of Tables 6. Building Loading Utility – Replication and Loading 7. Monitoring the better way 8. Collect Statistics the Better Way 9. Application and OPS DBA Insight 10. DBA Insight 11. Performance Tuning 12. Troubleshooting 13. Other Books You May Enjoy

Importing data

Let's get the ball rolling now.

We have had Teradata Studio Express and SQLA up and running for a while now. It is time to load data into the Teradata Database.

Now, there are many ways to do this, but, for simplicity, I will be importing data via Excel using the GUI option in Teradata Studio Express. You can copy the table data from Teradata to a data lab just by dragging the source table from the data lab view. The datalab copy wizard helps you through step by step.

A data lab is a separate dedicated work space, also known as a sandbox, sandpit or a test area.

You can get the dataset from various websites; there are tons of websites giving free datasets for analysis.

Getting started

The following are the prerequisites to import the data:

  1. Create a new user, for example, Mike.
  2. Create a new database, for example, TestDb.
  3. Allocate space to the new database.
  4. Grant appropriate access rights to the new database for the new user.

 

  1. Create a table DDL under this database with the same column layout as the import file:

How to do it...

Let's begin with importing data using Studio first and then we will move on to SQLA. The following DDL was used to create the table in the new database. Now load the data from the external file. The following steps allow you to do so:

  1. Go to data explorer. 
  2. Search for the database under which the required table is located:
  1. Explore the database.

 

  1. Right-click on the table, Name | Data | Load Data:
  1. The Wizard will come up; select the source as External File:
  1. On the next screen, just browse to the CSV file you need to load the data from.
  2. Once the data is loaded, you will get a success message. 
  3. To verify the data, right-click on the table, Name | Data | Sample Data; a few rows will pop up, showing that the data has been loaded.

In Express

This one is also as easy as Studio Express. The prerequisites are the same as Studio: 

  1. Select the Import data option from the File tab.
  2. You need to write SQL to start importing the data.
ins into AP.countries (?,?)
  1. ? here defines the number of columns in your file.
  2. Turn off the import function and execute Sel * from the table name to verify the data:
Use different formats to import files from Tools | Options | Export/Import.

To use the CSV file, select Options, as shown in the following screenshot:

Data transfer is a two-way street. We sometimes also have requirements to export the data to a file.

Teradata Studio Express and SQL Assistant both can be used to export data as well.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image