A presentation on table loader transformation
-
Upload
kaushal-solanki -
Category
Education
-
view
141 -
download
0
description
Transcript of A presentation on table loader transformation
A PRESENTATION ON TABLE LOADER TRANSFORMATION
Prepared By
Kauhsal Solanki
WHAT IS TABLE LOADER TRANSFORMATION ???
The Table Loader transformation generates code that reads a single source table (or view) and updates, replaces, or appends it to a permanent target table.
One can have table loader in their job with the below step mention.
Transformation
Access
Table Loader
WHAT ARE THE LOAD STYLES OF TABLE LOADER???
There are three types of load styles in table loader which are mention below.
Replace
Append To Existing
Update/Insert
LOAD STYLE-REPLACE
It is a default load style in Table Loader Transformation. There are basically three techniques are available with
Replace List.
• All Rows Using Delete
• Entire Table
• Simulating Truncate
HERE WHAT IT’S BASICALLY LOOKS LIKE
LOAD STYLE-REPLACE WITH REPLACE OPTION ENTIRE TABLE
When we are using Replace as load style, Entire Table is a default Replace option.
It uses PROC DATASETS to delete all the target tables.
Here first all the rows are deleted and than data from source data set is transferred to target data set.
LOAD STYLE-REPLACE WITH REPLACE OPTION ENTIRE TABLE(CONTINUE)
Source Data Set(Customer)
Target Data Set(CustomerInfo)
ID NAME SURNAME SALARY
1 Amar Gohel 10000
2 Milan Rana 20000
3 Marcel Poul 30000
ID NAME SURNAME GENDER
1 Amar Gohel M
2 Barbara Willis F
4 Vinay Shah M
LOAD STYLE-REPLACE WITH REPLACE OPTION ENTIRE TABLE(CONTINUE)
After applying Table Loader Transformation with Replace load style and entire table option as replace, target dataset(CustomerInfo) is as below
ID NAME SURNAME GENDER
1 Amar Gohel
2 Milan Rana
3 Marcel Poul
LOAD STYLE-REPLACE WITH REPLACE OPTION ALL ROWS USING DELETE
It uses pass-through sql with DELETE * to remove all rows and then data from source dataset is transferred to target data set.
It will give the same output as Entire Table Option as Replace but it is using a different technique to delete the existing source rows.
LOAD STYLE-REPLACE WITH REPLACE OPTION ALL ROWS USING
DELETE(CONTINUE)
Source Data Set(Customer)
Target Data Set(CustomerInfo)
LOAD STYLE-REPLACE WITH REPLACE OPTION ALL ROWS USING DELETE(CONTINUE)
After applying Table Loader Transformation with Replace load style and All Rows Using Delete option as replace, target dataset(CustomerInfo) is as below
LOAD STYLE-REPLACE WITH REPLACE OPTION SIMULATING TRUNCATE
It Uses a DATA step with SET and STOP statement to remove all rows.
It will give the same output as Entire Table Option as Replace and All Rows Using Delete but it is using a different technique to delete the existing source rows.
LOAD STYLE-REPLACE WITH REPLACE OPTION SIMULATING TRUNCATE(CONTINUE)
Source Data Set(Customer)
Target Data Set(CustomerInfo)
LOAD STYLE-REPLACE WITH REPLACE OPTION SIMULATING TRUNCATE(CONTINUE)
After applying Table Loader Transformation with Replace load style and Simulating Truncate option as replace, target dataset(CustomerInfo) is as below.
FUNCTIONS OF DIFFERENT REPLACE OPTION
Replace Description
All rows using delete Uses pass-through sql with DELETE * to remove all rows.
Entire Table Replaces the entire table using PROC DATASETS.
Simulating Truncate Uses a DATA step with SET and STOP statement to remove all rows.
LOAD STYLE-APPEND TO EXISTING
Here rows are added to the existing target table using PROC APPEND or PROC SQL.
It has no techniques available for it.
So basically it is used when one has to only append the source data to the destination dataset.
LOAD STYLE-APPEND TO EXISTING(CONTINUE)
Source Data Set(Customer)
Target Data Set(CustomerInfo)
LOAD STYLE-APPEND TO EXISTING(CONTINUE)
After applying Table Loader Transformation with Replace load style and Simulating Truncate option as replace, target dataset(CustomerInfo) is as below.
ID NAME SURNAME GENDER
1 Amar Gohel M
2 Barbara Willis F
4 Vinay Shah M
1 Amar Gohel
2 Milan Rana
3 Marcel Poul
LOAD STYLE-UPDATE/INSERT
It is different from other two, because it provides number of different options.
Here it is require to specify a key column, in column(s) to match portion.
It is necessary for Both dataset, source and destination to have the key column
An important option which comes with Update/Insert is Matching Rows.
LOAD STYLE-UPDATE/INSERT(CONTINUE…)
Matching Row contains basically three options within it, which are mention below.
Skip Matching Rows
Modify By Columns
SQL Set
LOAD STYLE-UPDATE/INSERT WITH MATCHING ROWS HAVING SQL SET OPTION
Uses PROC SQL with a SET clause to perform the updates to the target table.
In our example in columns match section we are defining ID as matching column.
Let’s have an example for this option.
LOAD STYLE-UPDATE/INSERT WITH MATCHING ROWS HAVING SQL SET OPTION(CONTINUE)
Source Data Set(Customer)
Target Data Set(CustomerInfo)
LOAD STYLE-UPDATE/INSERT WITH MATCHING ROWS HAVING SQL SET OPTION(CONTINUE)
After applying Table Loader Transformation with Update/Insert load style and SQL Set option within Matching Rows section, target dataset(CustomerInfo) is as below.
ID NAME SURNAME GENDER
1 Amar Gohel M
2 Barbara Willis F
4 Vinay Shah M
3 Marcel Poul
LOAD STYLE-UPDATE/INSERT WITH MATCHING ROWS HAVING MODIFY BY COLUMNS OPTION
It uses a DATA STEP with a MODIFY and a statement to perform the update and insert to the target table.
In our example in columns match section we are defining ID as matching column.
Let’s have an example for this option.
LOAD STYLE-UPDATE/INSERT WITH MATCHING ROWS HAVING MODIFY BY COLUMNS OPTION(CONTINUE)
Source Data Set(Customer)
Target Data Set(CustomerInfo)
LOAD STYLE-UPDATE/INSERT WITH MATCHING ROWS HAVING MODIFY BY COLUMNS OPTION(CONTINUE)
After applying Table Loader Transformation with Update/Insert load style and Modify By Columns option within Matching Rows section, target dataset(CustomerInfo) is as below.
LOAD STYLE-UPDATE/INSERT WITH MATCHING ROWS HAVING SKIP MATCHING ROWS OPTION
Ignores input rows that match rows in the target table only inserts are performed.
In our example in columns match section we are defining ID as matching column.
Let’s have an example for this option.
LOAD STYLE-UPDATE/INSERT WITH MATCHING ROWS HAVING SKIP MATCHING ROWS OPTION(CONTINUE)
Source Data Set(Customer)
Target Data Set(CustomerInfo)
LOAD STYLE-UPDATE/INSERT WITH MATCHING ROWS HAVING SKIP MATCHING ROWS OPTION(CONTINUE)
After applying Table Loader Transformation with Update/Insert load style and Skip Matching Rows option within Matching Rows section, target dataset(CustomerInfo) is as below.
ID NAME SURNAME GENDER
1 Amar Gohel M
2 Barbara Willis F
4 Vinay Shah M
3 Marcel Poul
LOAD STYLE-UPDATE/INSERT
Matching Rows Option Function.
Matching Rows Option
Description
Skip Matching Rows Ignores input rows that match rows in the target table only inserts are performed.
Modify By Columns It uses a DATA STEP with a MODIFY and a statement to perform the update and insert to the target table.
SQL Set Uses PROC SQL with a SET clause to perform the updates to the target table.
THANK YOU