SlideShare a Scribd company logo
4
Most read
5
Most read
13
Most read
ODI Multiple Flat Files to Table 2016
1
ODI (12.2.1.0.0)
Multiple CSV to Table via Interface with
dynamically getting of File Name with Status and
File Moved to Archive Folder
Document Made by: Darshankumar Prajapati & Ravindrakumar
Document Version: 1.0
Document Date: 02-Jul-2016
Document LastUpdated: 02-Jul-2016
ODI Multiple Flat Files to Table 2016
2
ODI Multiple Flat Files to Table 2016
3
Purpose: Suppose we have multipleCSV Files,thatwe have toloadinto Single Table viaSingle
Interface,alsoFile Name musttakenDynamic;alsowe have tomake a table withFile Name’sListwith
Loadedinto Table Status alongwiththeirRecordCount.
Prerequisites : It was assumed that before this Tutorial you are able to load a Data from Flat
File to Table via Single Interface in ODI(11.2.1.0.0 or Greater).
Software and Hardware Requirements (Optional):
The followingis alistof software requirements:
The systemshouldinclude the followinginstalledproducts:
Oracle Database 11.2.1.0.0 or Greater
Oracle Data Integrator12.2.1.0.0
If notdone before,startthe servicesandcomponentsforOracle Database 11g.
Created Model:
You are goingto make thistype of Model,so eachand everycomponentcanbe explainedindetailin
below(DetailedTechnical Steps) section.
ODI Multiple Flat Files to Table 2016
4
Detailed Technical Steps:
We have to make one Package underPackagesname usedhere is:Multiple_Csv.
1) Made_List_Of_Files:
Go to Diagram Tab and Select:ODIOSCommand.
Thiswill usedforTakingAll FilesName inOne FlatFile toachieve DynamicallyGettingof File
Name.
Put BelowcommandinCommandtoExecute Tab:
dir D:ODI12SOURCEseha*.CSV /b/o:gn>D:ODI12SOURCEFILES.CSV
In case of Linux:
Cd /u01/files/
Ls > FILES.csv
In above commandassume thatOur Multiple FlatFilesSource Locationis: D:ODI12SOURCE*.*
AndWe are doingonlyListingof all filesintoFlatFile called FILES.CSV.
ScreenShotof filesinMyDirectory:
ODI Multiple Flat Files to Table 2016
5
Afterexecutingthisyouwill have thesevalues inFILES.CSV.
2) Get_File_Name:
Nowwe have to create 1 Interface,whichwillloadDatafrom above createdFile (PQ.CSV)to
Table.
For thiswe needtocreate one table like below:
CREATE TABLE FILE_LIST
(
FILENAME VARCHAR2(240 BYTE),
STATUS CHAR(1 BYTE),
RECORD_COUNT NUMBER)
Nowyouwill have tocreate On Interface inwhich FILES.CSVas a Source andFILE_LIST as
Target.
Screenshotof Interface created:
ODI Multiple Flat Files to Table 2016
6
- In Statusyoucan Hardcode ‘N’for a time.
- We will Update Record_CountLaterviaseparate procedure.
3) File_name
Nowwe needtocreate on LOCAL VARIABLEas showninBelow ScreenShots:
Thisis Refresh Variable:
Step1:
ODI Multiple Flat Files to Table 2016
7
Step2:
In thisBelowqueryisused:
selectfilename fromfile_listwhere loaded='N'
and rownum<=1
It will justgetsfile name forwhichwe are goingtoload data inTarget Table.
4) Nowwe needtohave One Mapping whichwill loadDatafromFlat File toTable.
In our case we have simplymade table same asFile,andmapeach and every column.
Step1:
ODI Multiple Flat Files to Table 2016
8
Step2:
Physical diagramDetails:
ODI Multiple Flat Files to Table 2016
9
ThisMapping will simply insertDatafrom FlatFile toour Target Table.
5) Update_loaded_file_status:
Nowwe needtohave One PROCEDURE whichwill Update File Statuswhichwasbydefault‘N’in
step2, thiswill setthat as ‘Y’,andWill AlsoputRECORD COUNT inthat FILELIST_STATUS table.
Queryusedto achieve thisis:
update file_listsetloaded='Y',record_count='<%=odiRef.getPrevStepLog("INSERT_COUNT")%>'
where filename='#FILE_NAME'
In this odiRef.getPrevStepLog("INSERT_COUNT") willsimplygetsRecordCountforParticularStepin
ODI.
Step1:
Step2:
ODI Multiple Flat Files to Table 2016
10
Step3:
ODI Multiple Flat Files to Table 2016
11
.
6) File Remainsto Process:
Nowwe needtohave one Variable whichwill countHow manyfilesare still remainstobe proceesed.
Step1:
ODI Multiple Flat Files to Table 2016
12
Step2:
QueryUsed:
selectcount(filename) fromfile_listwhere loaded='N'
Step3:
ODI Multiple Flat Files to Table 2016
13
7) Moving_files_to_Archive:
Nowwe needtoMove thisprocessedflatfile toArchive Directory.
For thiswe needtouse “ODIFILEMOVE” as below:
Step1:
Step2:
8) File_remains_to_Process:
Nowwe need tocross check How Many Filesare Still RemainstoLoad.
For thiswe needtoReuse Variable File_remains_to_Process asEVALUATEVARIBALEasshownbelow:
So itwill be automaticallystoppedwhenFile_CountNOT>0.
ODI Multiple Flat Files to Table 2016
14
So at the endYou have createdthe below Model.
Afterrunningof thisProcedure youcan checkfile statusinFILELIST_STATUSTable as below:
You can cross checknow FilesSuccessfullymovedtotargetdirectory:
ODI Multiple Flat Files to Table 2016
15
You can cross checkRecord Countinyour Final Table inwhichyouhave loadedData.
Summary:
In thistutorial,youhave learnedhowto:
Verifythe Prerequisites.
Create one ODI_OS_COMMAND forjustlistingof youall flatfliesintoSingle FlatFile.
Create a NewODI Model forthe FlatFile Source toTarget Database Table.
Create a NewODI Source Datastore for Use withODI Interface
Create a NewODI TargetDatastore forUse withODI Interface
Create a Variable forFile_remains_to_Process,File_Name.
Create a Mapping whichwill LoadData fromFlatfile toOracle Table.
Create a procedure whichwill UpdatesaFile Status inTable alongwithRecordCount.
Create a ODI_FILE_MOVE for movingyourprocessedfile toARCHIVEDirectory.
ODI Multiple Flat Files to Table 2016
16
Hope you have understoodwhich we have developedwiththe helpof thisdocument.
Hope you have learnednewthings,if youhave done somethinglikethis,please share iton
darshanprajapati@ymail.com andravindra_kumar67@rediffmail.com .
THANKYOU ! KEEP ODIING!!!!

More Related Content

What's hot (20)

DOCX
ODI 11g - Multiple Flat Files to Oracle DB Table by taking File Name dynamica...
Darshankumar Prajapati
 
DOCX
Multiple files single target single interface
Dharmaraj Borse
 
DOCX
ODI User and Security
Darshankumar Prajapati
 
PPT
Sql Server Basics
rainynovember12
 
PPT
Oracle backup and recovery
Yogiji Creations
 
PDF
Odi 12c-getting-started-guide-2032250
Udaykumar Sarana
 
DOCX
Odi interview questions
Udaykumar Sarana
 
PPTX
Oracle EBS R12.2 - Deployment and System Administration
Mozammel Hoque
 
PDF
EBS-technical_upgrade_best_practices 12.1 or 12.2
Berry Clemens
 
KEY
Trees In The Database - Advanced data structures
Lorenzo Alberton
 
PPTX
Best Practices with ODI : Flexibility
Gurcan Orhan
 
PPTX
The Basics of MongoDB
valuebound
 
PDF
What Is RDD In Spark? | Edureka
Edureka!
 
PPTX
Data Guard Architecture & Setup
Satishbabu Gunukula
 
PPTX
Cloning Oracle EBS R12: A Step by Step Procedure
Orazer Technologies
 
PDF
Finit solutions - Automating Data Loads with FDMEE
finitsolutions
 
PDF
PostgreSQL Tutorial For Beginners | Edureka
Edureka!
 
PDF
Apache Arrow Workshop at VLDB 2019 / BOSS Session
Wes McKinney
 
PPTX
OLTP+OLAP=HTAP
EDB
 
PDF
Step by Step Restore rman to different host
Osama Mustafa
 
ODI 11g - Multiple Flat Files to Oracle DB Table by taking File Name dynamica...
Darshankumar Prajapati
 
Multiple files single target single interface
Dharmaraj Borse
 
ODI User and Security
Darshankumar Prajapati
 
Sql Server Basics
rainynovember12
 
Oracle backup and recovery
Yogiji Creations
 
Odi 12c-getting-started-guide-2032250
Udaykumar Sarana
 
Odi interview questions
Udaykumar Sarana
 
Oracle EBS R12.2 - Deployment and System Administration
Mozammel Hoque
 
EBS-technical_upgrade_best_practices 12.1 or 12.2
Berry Clemens
 
Trees In The Database - Advanced data structures
Lorenzo Alberton
 
Best Practices with ODI : Flexibility
Gurcan Orhan
 
The Basics of MongoDB
valuebound
 
What Is RDD In Spark? | Edureka
Edureka!
 
Data Guard Architecture & Setup
Satishbabu Gunukula
 
Cloning Oracle EBS R12: A Step by Step Procedure
Orazer Technologies
 
Finit solutions - Automating Data Loads with FDMEE
finitsolutions
 
PostgreSQL Tutorial For Beginners | Edureka
Edureka!
 
Apache Arrow Workshop at VLDB 2019 / BOSS Session
Wes McKinney
 
OLTP+OLAP=HTAP
EDB
 
Step by Step Restore rman to different host
Osama Mustafa
 

Recently uploaded (20)

PPTX
GenAI-Introduction-to-Copilot-for-Bing-March-2025-FOR-HUB.pptx
cleydsonborges1
 
PDF
apidays Helsinki & North 2025 - Monetizing AI APIs: The New API Economy, Alla...
apidays
 
PDF
Copia de Strategic Roadmap Infographics by Slidesgo.pptx (1).pdf
ssuserd4c6911
 
PDF
MusicVideoProjectRubric Animation production music video.pdf
ALBERTIANCASUGA
 
PDF
Context Engineering for AI Agents, approaches, memories.pdf
Tamanna
 
PDF
JavaScript - Good or Bad? Tips for Google Tag Manager
📊 Markus Baersch
 
PPTX
Exploring Multilingual Embeddings for Italian Semantic Search: A Pretrained a...
Sease
 
PPTX
recruitment Presentation.pptxhdhshhshshhehh
devraj40467
 
PDF
R Cookbook - Processing and Manipulating Geological spatial data with R.pdf
OtnielSimopiaref2
 
PPTX
Advanced_NLP_with_Transformers_PPT_final 50.pptx
Shiwani Gupta
 
PDF
Product Management in HealthTech (Case Studies from SnappDoctor)
Hamed Shams
 
PDF
Data Chunking Strategies for RAG in 2025.pdf
Tamanna
 
PDF
apidays Helsinki & North 2025 - API-Powered Journeys: Mobility in an API-Driv...
apidays
 
PDF
OPPOTUS - Malaysias on Malaysia 1Q2025.pdf
Oppotus
 
PPTX
apidays Helsinki & North 2025 - Vero APIs - Experiences of API development in...
apidays
 
PPTX
apidays Helsinki & North 2025 - Running a Successful API Program: Best Practi...
apidays
 
PPTX
apidays Helsinki & North 2025 - Agentic AI: A Friend or Foe?, Merja Kajava (A...
apidays
 
PPTX
apidays Munich 2025 - Building an AWS Serverless Application with Terraform, ...
apidays
 
PPT
Data base management system Transactions.ppt
gandhamcharan2006
 
PPTX
apidays Helsinki & North 2025 - API access control strategies beyond JWT bear...
apidays
 
GenAI-Introduction-to-Copilot-for-Bing-March-2025-FOR-HUB.pptx
cleydsonborges1
 
apidays Helsinki & North 2025 - Monetizing AI APIs: The New API Economy, Alla...
apidays
 
Copia de Strategic Roadmap Infographics by Slidesgo.pptx (1).pdf
ssuserd4c6911
 
MusicVideoProjectRubric Animation production music video.pdf
ALBERTIANCASUGA
 
Context Engineering for AI Agents, approaches, memories.pdf
Tamanna
 
JavaScript - Good or Bad? Tips for Google Tag Manager
📊 Markus Baersch
 
Exploring Multilingual Embeddings for Italian Semantic Search: A Pretrained a...
Sease
 
recruitment Presentation.pptxhdhshhshshhehh
devraj40467
 
R Cookbook - Processing and Manipulating Geological spatial data with R.pdf
OtnielSimopiaref2
 
Advanced_NLP_with_Transformers_PPT_final 50.pptx
Shiwani Gupta
 
Product Management in HealthTech (Case Studies from SnappDoctor)
Hamed Shams
 
Data Chunking Strategies for RAG in 2025.pdf
Tamanna
 
apidays Helsinki & North 2025 - API-Powered Journeys: Mobility in an API-Driv...
apidays
 
OPPOTUS - Malaysias on Malaysia 1Q2025.pdf
Oppotus
 
apidays Helsinki & North 2025 - Vero APIs - Experiences of API development in...
apidays
 
apidays Helsinki & North 2025 - Running a Successful API Program: Best Practi...
apidays
 
apidays Helsinki & North 2025 - Agentic AI: A Friend or Foe?, Merja Kajava (A...
apidays
 
apidays Munich 2025 - Building an AWS Serverless Application with Terraform, ...
apidays
 
Data base management system Transactions.ppt
gandhamcharan2006
 
apidays Helsinki & North 2025 - API access control strategies beyond JWT bear...
apidays
 
Ad

Multiple Flat Files(CSV) to Target Table in ODI12c(12.2.1.0.0)

  • 1. ODI Multiple Flat Files to Table 2016 1 ODI (12.2.1.0.0) Multiple CSV to Table via Interface with dynamically getting of File Name with Status and File Moved to Archive Folder Document Made by: Darshankumar Prajapati & Ravindrakumar Document Version: 1.0 Document Date: 02-Jul-2016 Document LastUpdated: 02-Jul-2016
  • 2. ODI Multiple Flat Files to Table 2016 2
  • 3. ODI Multiple Flat Files to Table 2016 3 Purpose: Suppose we have multipleCSV Files,thatwe have toloadinto Single Table viaSingle Interface,alsoFile Name musttakenDynamic;alsowe have tomake a table withFile Name’sListwith Loadedinto Table Status alongwiththeirRecordCount. Prerequisites : It was assumed that before this Tutorial you are able to load a Data from Flat File to Table via Single Interface in ODI(11.2.1.0.0 or Greater). Software and Hardware Requirements (Optional): The followingis alistof software requirements: The systemshouldinclude the followinginstalledproducts: Oracle Database 11.2.1.0.0 or Greater Oracle Data Integrator12.2.1.0.0 If notdone before,startthe servicesandcomponentsforOracle Database 11g. Created Model: You are goingto make thistype of Model,so eachand everycomponentcanbe explainedindetailin below(DetailedTechnical Steps) section.
  • 4. ODI Multiple Flat Files to Table 2016 4 Detailed Technical Steps: We have to make one Package underPackagesname usedhere is:Multiple_Csv. 1) Made_List_Of_Files: Go to Diagram Tab and Select:ODIOSCommand. Thiswill usedforTakingAll FilesName inOne FlatFile toachieve DynamicallyGettingof File Name. Put BelowcommandinCommandtoExecute Tab: dir D:ODI12SOURCEseha*.CSV /b/o:gn>D:ODI12SOURCEFILES.CSV In case of Linux: Cd /u01/files/ Ls > FILES.csv In above commandassume thatOur Multiple FlatFilesSource Locationis: D:ODI12SOURCE*.* AndWe are doingonlyListingof all filesintoFlatFile called FILES.CSV. ScreenShotof filesinMyDirectory:
  • 5. ODI Multiple Flat Files to Table 2016 5 Afterexecutingthisyouwill have thesevalues inFILES.CSV. 2) Get_File_Name: Nowwe have to create 1 Interface,whichwillloadDatafrom above createdFile (PQ.CSV)to Table. For thiswe needtocreate one table like below: CREATE TABLE FILE_LIST ( FILENAME VARCHAR2(240 BYTE), STATUS CHAR(1 BYTE), RECORD_COUNT NUMBER) Nowyouwill have tocreate On Interface inwhich FILES.CSVas a Source andFILE_LIST as Target. Screenshotof Interface created:
  • 6. ODI Multiple Flat Files to Table 2016 6 - In Statusyoucan Hardcode ‘N’for a time. - We will Update Record_CountLaterviaseparate procedure. 3) File_name Nowwe needtocreate on LOCAL VARIABLEas showninBelow ScreenShots: Thisis Refresh Variable: Step1:
  • 7. ODI Multiple Flat Files to Table 2016 7 Step2: In thisBelowqueryisused: selectfilename fromfile_listwhere loaded='N' and rownum<=1 It will justgetsfile name forwhichwe are goingtoload data inTarget Table. 4) Nowwe needtohave One Mapping whichwill loadDatafromFlat File toTable. In our case we have simplymade table same asFile,andmapeach and every column. Step1:
  • 8. ODI Multiple Flat Files to Table 2016 8 Step2: Physical diagramDetails:
  • 9. ODI Multiple Flat Files to Table 2016 9 ThisMapping will simply insertDatafrom FlatFile toour Target Table. 5) Update_loaded_file_status: Nowwe needtohave One PROCEDURE whichwill Update File Statuswhichwasbydefault‘N’in step2, thiswill setthat as ‘Y’,andWill AlsoputRECORD COUNT inthat FILELIST_STATUS table. Queryusedto achieve thisis: update file_listsetloaded='Y',record_count='<%=odiRef.getPrevStepLog("INSERT_COUNT")%>' where filename='#FILE_NAME' In this odiRef.getPrevStepLog("INSERT_COUNT") willsimplygetsRecordCountforParticularStepin ODI. Step1: Step2:
  • 10. ODI Multiple Flat Files to Table 2016 10 Step3:
  • 11. ODI Multiple Flat Files to Table 2016 11 . 6) File Remainsto Process: Nowwe needtohave one Variable whichwill countHow manyfilesare still remainstobe proceesed. Step1:
  • 12. ODI Multiple Flat Files to Table 2016 12 Step2: QueryUsed: selectcount(filename) fromfile_listwhere loaded='N' Step3:
  • 13. ODI Multiple Flat Files to Table 2016 13 7) Moving_files_to_Archive: Nowwe needtoMove thisprocessedflatfile toArchive Directory. For thiswe needtouse “ODIFILEMOVE” as below: Step1: Step2: 8) File_remains_to_Process: Nowwe need tocross check How Many Filesare Still RemainstoLoad. For thiswe needtoReuse Variable File_remains_to_Process asEVALUATEVARIBALEasshownbelow: So itwill be automaticallystoppedwhenFile_CountNOT>0.
  • 14. ODI Multiple Flat Files to Table 2016 14 So at the endYou have createdthe below Model. Afterrunningof thisProcedure youcan checkfile statusinFILELIST_STATUSTable as below: You can cross checknow FilesSuccessfullymovedtotargetdirectory:
  • 15. ODI Multiple Flat Files to Table 2016 15 You can cross checkRecord Countinyour Final Table inwhichyouhave loadedData. Summary: In thistutorial,youhave learnedhowto: Verifythe Prerequisites. Create one ODI_OS_COMMAND forjustlistingof youall flatfliesintoSingle FlatFile. Create a NewODI Model forthe FlatFile Source toTarget Database Table. Create a NewODI Source Datastore for Use withODI Interface Create a NewODI TargetDatastore forUse withODI Interface Create a Variable forFile_remains_to_Process,File_Name. Create a Mapping whichwill LoadData fromFlatfile toOracle Table. Create a procedure whichwill UpdatesaFile Status inTable alongwithRecordCount. Create a ODI_FILE_MOVE for movingyourprocessedfile toARCHIVEDirectory.
  • 16. ODI Multiple Flat Files to Table 2016 16 Hope you have understoodwhich we have developedwiththe helpof thisdocument. Hope you have learnednewthings,if youhave done somethinglikethis,please share iton [email protected] [email protected] . THANKYOU ! KEEP ODIING!!!!