You are on page 1of 10

Teradata 13.

0
Joiner Transformation using Fast load Utility

Description:
BISP is committed to provide BEST learning material to the beginners and advance learners. In the same series, we have prepared a complete end-to end Hands-on Guide for building financial data model in Teradata. The document focuses on how the real world requirement should be interpreted. The mapping document template with very simplified steps and screen shots makes the complete learning so easy. The document focuses on hands-on practice for joiner transformation using Fast Load Utility. Join our professional training program and learn from experts.

History:
Version 0.1 0.1 Description Change Initial Draft Review#1 Author Anil Tekam Amit Sharma Publish Date 12th Aug 2011 18th Aug 2011

www.bispsolutions.com www.bisptrainings.com

| |

www.hyperionguru.com Page 1

Contents
Contents.......................................................................................................................... 2 Introduction .................................................................................................................... 3 Summary......................................................................................................................... 3 Mapping sheet of Source to Target (CUSTOMER_CREDIT):........................................................................................................................................ 3 Data Model...................................................................................................................... 4 Steps to Perform Join Transformation.............................................................................. 4

www.bispsolutions.com www.bisptrainings.com

| |

www.hyperionguru.com Page 2

Introduction
This is one of document of joiner transformation. In this document we have performed the join operation with the help of fast export utility and load that data with the help of fast load utility.

Summary
In this joiner transformation, we have joined the two different tables with the help of fast export utility. This fast export utility generates the output data. Then we have created the target table and then we loaded the data (which is exist in output data file) in this target table. For loading the data into target table we have used the fast load utility. This fast load utility help for loading the data.

Mapping sheet of Source to Target (CUSTOMER_CREDIT):-

www.bispsolutions.com www.bisptrainings.com

| |

www.hyperionguru.com Page 3

Data Model

Steps to Perform Join Transformation


Step #1:-We create the target table named as CUSTOMER_CREDIT table and this table has created by joining two different tables i.e. SRC_BRANCH_CD and SRC_CREDITCARD2 table.

www.bispsolutions.com www.bisptrainings.com

| |

www.hyperionguru.com Page 4

Step #2:-Now we create the fast export flat file script. In this fast export script we have used the one DML operation i.e. Sql select query. We have performed the joiner operation in this sql select query. 1.) BEGIN EXPORT STATEMENT. 2.) DEFINE THE OUTPUT FILE NAME. 3.)THE SELECT PULLS DATA FROM TABLE (SRC_CREDITCARD2,SRC_BRANCH_CD). 4.) END THE JOB AND LOGOFF TERADATA.
/* ---------------------------------------------------------------*/ /* @(#) FASTEXPORT SCRIPT */ /* @(#) Version 1.1 */ /* @(#) Created by BISP Team */ /* ---------------------------------------------------------------*/ ALWAYS GOOD TO IDENTIFY THE SCRIPT AND AUTHOR IN COMMENTS

Step #3:-Now we execute this fast export flat file script in command prompt. After the successful execution, it will generate the some flat files.

Step #4:-Now fast export fast flat file has successfully executed and it has generate output log file (left_out_log.txt) and output data file or we can say that system generate file i.e. left_join_data.txt file.

www.bispsolutions.com www.bisptrainings.com

| |

www.hyperionguru.com Page 5

Step #6:-Now we are showing the system generated file i.e. left_join_data.txt file. All the records (which has come with the help of fast export utility) come in system generated language.

Step #7:-Now we create the fast load flat file script. We use this fast load utility for performing the insert operation. 1.) LOGIN ONTO TERADATA. 2.) DEFINING INPUT DATA FILE 3.) DEFINING THE ERROR FILES 4.) FAST LOAD PERFORM END LOADING. 5.) DEFINE LOGOFF CONNECTION

/* /* /* /* /* /*

++++++++++++++++++++++++++++*/ FASTLOAD SCRIPT TO LOAD THE */ Financial.CUSTOMER_CREDIT TABLE */ Version 1.1 */ Created by BISP Team */ ++++++++++++++++++++++++++++*/

Always good to identify the script and author in comment.

www.bispsolutions.com www.bisptrainings.com

| |

www.hyperionguru.com Page 6

1.) LOGIN ONTO TERADATA:- we logon into the Teradata fast load utility. 2.) DEFINING INPUT DATA FILE:- Now we comes the DEFINE statement. Fast load must know the structure and the name of the flat file to be used as the input flat file or source file for loading the data. 3.) DEFINING THE ERROR FILES:- In this script, there is no create table statement for the error tables. This error files work as error table. Fast load automatically generate both error table. In this instance, they are named emp1_sal and UV_sal table. First error table (emp1_sal) contains only constraints based related error and second error table (UV_sal) contains only unique violation error. 4.) FAST LOAD PERFORM END LOADING:- The target table must be empty at the loading time and if the loading has completed, then we use the END LOADING statement. If we don't use the END LOADING statement then we get error i.e. Target table being loaded and that time we can't access the loading data. 5.) DEFINE LOGOFF CONNECTION:Now all the sessions has logoff. This is the last statement of this fast load script. Now the table lock has released and if no rows in the error table, then that error table automatically dropped and if there is any single row in error table then we check it, then we take appropriate action and drop that error table manually. Step #8:-Now we execute the fast load flat file script in command prompt. We have written the fast load flat file name also written the output log file name in command prompt.

Step #9:- Now this fast load input script has successfully executed and it has generated the fast load output log file script (fload_join_log.txt). www.bispsolutions.com www.bisptrainings.com | | www.hyperionguru.com Page 7 |

Step #10:- This is the complete script of fast load output log file. This output log file contains all the information, which has performed by the fast load utility. 1.)DEFINING LOGON CONNECTION. 2.)INSERT PHASE. 3.)END LOADING PHASE.

www.bispsolutions.com www.bisptrainings.com

| |

www.hyperionguru.com Page 8

1.)DEFINING LOGON CONNECTION:- In this logon statement, we have successfully created the logon connection of fast load utility. 2.)INSERT PHASE:- In this insert phase, we have performed the DML operation i.e. insert operation. In this insert operation, we are sending all 14 records from output data file (left_join_data.txt) to target table i.e. CUSTOMER_CREDIT table. 3.)END LOADING PHASE:- In this END LOADING PHASE, we have completed the loading process into the target table. We have read total 14 records from source and the insert operation has applied all the 14 records. There is no error in error table 1 and error table 2. Automatically dropped both error tables. There is no duplicate rows in target table. Step #11:-Now the target table i.e. CUSTOMER_CREDIT has successfully loaded. This is the join data, which has loaded successfully.

www.bispsolutions.com www.bisptrainings.com

| |

www.hyperionguru.com Page 9

www.bispsolutions.com www.bisptrainings.com

| |

www.hyperionguru.com Page 10

You might also like