I'm newbie at ODI (Oracle Data Integrator) 11g. I have XML file. I need to load data from that XML file into Oracle Database. I'm created project, imported knowledge module, created XML & Oracle model.
Note : My XML File consisted from 40+ table.
Target datastore is only stores 1 table at moment.
Edit
Based on the comment, this is a way to load several "same xsd" xml files.
First, you must ensure that all XML do have the same XSD structure, or else you might experience strange behaviour.
To process more than one XML file, basically this is what you have to do:
1) You give a specific fixed XML name, and create your topology based on it. 2) Create a "file processing control" to rename and move the files before reading. 3) Make sure you do the proper "synchronizing" commands
Example
You have XML files:
/path/in/XML001.XML
/path/in/XML002.XML
/path/in/XML003.XML
Save one of the files as XML_DATA.xml, and setup your topology with XML_DATA.xml in some '/work/' path, verify that it's all good by testing.
Process a Loop where:
1) Move /path/in/XML001.XML to /path/work/XMLDATA.XML (overwrite or delete old XMLDATA)
2) Execute "SYNCHRONIZE FROM FILE"
3) Process your Interfaces
4) Execute "SYNCHRONIZE FROM DB"
5) Move processed XML to "/path/processed/"
Your Package would be something like:
[Loop] > [MoveFile] > [ProcedureSync] > [Interfaces] > [ProcedureSync] > [MoveFile] > [EndLoop]
About the Loop control, there is a few ways to do it, if you have doubts I can send you tips.
Hope that helps!
Edit 2
Based in the new information I will try to send a better explanation about the questions asked. This is not such a difficult mission, but to someone who is still understanding ODI tool it may sound hard.
The main point is to understand that for ODI a XML file is a data source just like a Database, and not a file like a .csv.
1) Example of using Synchronizing when working with XML files.
Whenever accessing a XML file for reading or writing, it's recomended to proceed as folow:
2) File Processing Control
In the Package, inside the Toolbox bar, there is a "File" toolbar that gives you a lot of useful File tools, like copy, delete, move, zip, unzip, etc. This is useful when you need to "control" the files you are reading, renaming, etc.
You can play a little with these tools, they are very easy to understand.
3) Loop Control
In ODI you can develop a loop using variables in a package. Sometimes you can process loops just by using the odi Procedure, it depends on your needs. Based in the few information I have about your context, I would suggest you try using variables first.
So here is an example that process a loop 5 times.
1) Create a Variable as Number.
2) Drag it to the package and set the value to 0.
3) Drag it again, configure it as Evaluation, set the condition to Equal to 5.
4) Drag any "test" interface that you have.
5) Link the KO Link to the Interface. When using evaluating variables, KO links acts like the "false" condition. In our case, it will point to the interface if the counter is < 5.
6) Drag the variable again, this time instead of setting a fixed value, you will set an incremental by 1. This will add 1 to the value.
7) Link this last variable to the Evaluate variable.
So, this will run 5 times your test interface. I found an image in the internet that ilustrates this:
You can find useful information here "https://dzone.com/articles/odi-11g-implementing-loops" and "https://blogs.oracle.com/dataintegration/using-variables-in-odi:-creating-a-loop-in-a-package".
Final Package
In the end of the day, your "algorithm" would be something like this:
1) Process the Loop through the Files in the folder (this is a little tricky, it may need a jython code, you can find a reference to do that here "https://blogs.perficient.com/2014/08/01/looping-through-files-in-a-folder-using-odi/")
2) Move the first file to /work/OMDATASOURCE.xml
3) SYNCHRONIZE FROM DATABASE command.
4) Process your Interfaces
5) SYNCHRONIZE FROM FILE command.
6) Move OMDATASOURCE.xml to '/processed' or any other control you create.
7) Process Next File. You may also want to control some stuff using tables, like files readed, files processed, etc.
8) End Loop (using the loop control examples I sent).
ODI is very flexible and extensible, you can do everything, in a lot of ways.
Considerations
Hope this will help, []'s
Cheers