Teradata Basics
- Teradata - SubQueries
- Teradata - Joins
- Teradata - Primary Index
- Teradata - CASE & COALESCE
- Teradata - Aggregate Functions
- Teradata - Built-in Functions
- Teradata - Date/Time Functions
- Teradata - String Manipulation
- Teradata - SET Operators
- Logical & Conditional Operators
- Teradata - SELECT Statement
- Teradata - Data Manipulation
- Teradata - Tables
- Teradata - Data Types
- Teradata - Relational Concepts
- Teradata - Architecture
- Teradata - Installation
- Teradata - Introduction
Teradata Advanced
- Teradata - BTEQ
- Teradata - FastExport
- Teradata - MultiLoad
- Teradata - FastLoad
- Teradata - Performance Tuning
- Teradata - User Management
- Teradata - Data Protection
- Teradata - OLAP Functions
- Teradata - Partitioned Primary Index
- Teradata - JOIN Strategies
- Teradata - Stored Procedure
- Teradata - Macros
- Teradata - Views
- Teradata - Join Index
- Teradata - Hashing Algorithm
- Teradata - Explain
- Teradata - Compression
- Teradata - Statistics
- Teradata - Secondary Index
- Teradata - Space Concepts
- Teradata - Table Types
Teradata Useful Resources
- Teradata - Discussion
- Teradata - Useful Resources
- Teradata - Quick Guide
- Teradata - Questions & Answers
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Teradata - FastExport
FastExport utipty is used to export data from Teradata tables into flat files. It can also generate the data in report format. Data can be extracted from one or more tables using Join. Since FastExport exports the data in 64K blocks, it is useful for extracting large volume of data.
Example
Consider the following Employee table.
EmployeeNo | FirstName | LastName | BirthDate |
---|---|---|---|
101 | Mike | James | 1/5/1980 |
104 | Alex | Stuart | 11/6/1984 |
102 | Robert | Wilpams | 3/5/1983 |
105 | Robert | James | 12/1/1984 |
103 | Peter | Paul | 4/1/1983 |
Following is an example of a FastExport script. It exports data from employee table and writes into a file employeedata.txt.
.LOGTABLE tduser.employee_log; .LOGON 192.168.1.102/dbc,dbc; DATABASE tduser; .BEGIN EXPORT SESSIONS 2; .EXPORT OUTFILE employeedata.txt MODE RECORD FORMAT TEXT; SELECT CAST(EmployeeNo AS CHAR(10)), CAST(FirstName AS CHAR(15)), CAST(LastName AS CHAR(15)), CAST(BirthDate AS CHAR(10)) FROM Employee; .END EXPORT; .LOGOFF;
Executing a FastExport Script
Once the script is written and named as employee.fx, you can use the following command to execute the script.
fexp < employee.fx
After executing the above command, you will receive the following output in the file employeedata.txt.
103 Peter Paul 1983-04-01 101 Mike James 1980-01-05 102 Robert Wilpams 1983-03-05 105 Robert James 1984-12-01 104 Alex Stuart 1984-11-06
FastExport Terms
Following is the pst of terms commonly used in FastExport script.
LOGTABLE − Specifies the log table for restart purpose.
LOGON − Logs into Teradata and initiates one or more sessions.
DATABASE − Sets the default database.
BEGIN EXPORT − Indicates the beginning of the export.
EXPORT − Specifies the target file and the export format.
SELECT − Specifies the select query to export data.
END EXPORT − Specifies the end of FastExport.
LOGOFF − Ends all sessions and terminates FastExport.