Monday, December 5, 2016

How to create file datastore for hierarchy data?

Scenario:
Client is maintainting Customer and Item information in file as follows.

1,1,Trinesh,kumar Reddy,Koduru,250
2,1,1,Soap,10,10,100
2,2,1,Paste,2,75,150
1,2,Tejesh,Kumar Reddy,Koduru,350
2,3,2,Pen,10,15,150
2,4,2,Pencil,10,5,50
2,5,2,Pad,2,50,100
2,6,2,Wallet,1,50,50

The record starts with 1 belongs to Customer information and record starts with 2 belongs to items purchased by the custoemr
1 - Customer information
2 - Item information

I need to load customer information into customer table and Items purchased by customer will be loaded into items table.

Pre-requisites:
Assumptions
1.Already Topology configuration is available
(Physical Architecture
Technology-File
DataServer
Physical Schema(Folder Location)
Technology-Oracle
DataServer
Physical Schema(Schema)

Logical Architecture
Technology-File
Logical Schema(LG_File_SRC)
Technology-Oracle
Logical Schema(LG_ORCL_TRG)
Context
Global
Schema Tab - LG_File_SRC - Physical Schema of File
    LG_ORCL_TRG - Physical Schema of Oracle)

Steps:
1.Login to ODI
2.Go to Designer Navigator
3.Expand Model Accordion
4.Create Model for Source
FILE_SRC(Model)-->Logical Schema as mentioned above (i.e., LG_File_SRC) --> Reverse Engineer tab, select context as global)
Right click model and click on new datastore
Provide DataStore name as "Header" --> Resource Name "Select File Name"
Go to File tab --> File Format as "Delimited" --> Field Seperator (others --> ,)
Go to Attributes tab --> Create attributes as mention below screenshot


Provide DataStore name as "Detail" --> Resource Name "Select File Name"
Go to File tab --> File Format as "Delimited" --> Field Seperator (others --> ,)
Go to Attributes tab --> Create attributes as mention below screenshot


ORCL_TRG(Model) (Assumption you are aware of this step)

5.Right click on Header (datastore) click on viewdata. You can see data in the below screenshot

Right click on Detail (Datastore) click on viewdata. You can see data in the below screenshot





No comments:

Post a Comment