Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Fixed Width Flat File - RDBMS table Loading

Hi Gurus,

Let us discuss how to load data from a Fixed width flat file to RDBMS target table.

I have a flat file with the name DEPT.txt in my windows C:/FILES folder
The flat file DEPT.txt is a Fixed width flat file with the following data

DEPTNO DNAME LOC


10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON

Now inorder to load this file to oracle table of same structure , first you need to set the topology
( Please ignore the following few steps if you have already set the topology and created a model for
files)
Run ODI Studio
Go to Topology navigator
Click on physical architecture
Select file technology
Right click on new physical schema
Give the path of your source files directory in schema and work schema
click on context
Click on +
Give logical schema as SRC_FILES_LS
Click on save

Create a new model for file technology as shown below


Click on save
Right click on the new file model
Click on new data store
Now the new data store creation wizard opens
Enter the name of the data store as DEPT
Click on search button in the resource field
And then select the respective file
click open
Then click on Files tab

Click on Files tab


set the parameters as shown below
Then click on Columns tab
and click on reverse engineer button as shown below
Create the columns by selecting the width of the each column
Enter the names of each column and select the string data type as shown below
Click on save

You have to import the knowledge module " LKM FILE to SQL". Please ignore this step if you have
already done it earlier.
Now Expand your integration project
Right click on import knowledge modules
and then import the Loading knowledge module " LKM FILE to SQL"

Then create a new interface as DEPT file data store as your source and TRG_DEPT Oracle table data
store as your target.
Perform automatic mapping
Click on FLOW tab

Click on Target to see the IKM target properties


Set the "flow_control" option to false
Set the "Truncate" option to true
Click on save
Click on execute

Go to operator log
Check the log for this session
Open it and check the number of inserts

You might also like