Search code examples
oraclefileoracle12coracle-data-integratorfile-import

How to call a Mapping for each incoming file in Oracle Data Integrator (ODI)


I am working with Oracle Data Integrator 12c and I have a number of txt files, which somebody copies into a folder "/import". ODI should notice this and call a Mapping for each file. Then each file should be saved in another folder "/export"

My mapping is working perfectly for one file. I specified this file in the model part. But how can I dynamically load each file and let the mapping also work with each file and then save it?

I hope it is clear what I want :)

Thanks in advance


Solution

  • I have completed a similar process to your need. It was not an exact need but steps may help you. My solution was a bit tricky, since a third party send files into a directory via FTP and there is no limitation for number of files or file name standard.

    Since the job was in a former client I am not able to provide you whole step codes and screenshots but I may tell the outline. You will need an ODI package

    1. In OSCommand component I gave ls >> filelist.txt
    2. I had an interface reading file filelist.txt into a table with a sequence number for each row.
    3. I had an ODI Variable #MAX_ROW_NUM which reads the maximum file number from table above.
    4. Evaluate variable for #MAX_ROW_NUM > 0
    5. Get file name into #FILE_NAME variable from table where ROW_NUM = #MAX_ROW_NUM
    6. Using #FILE_NAME execute the interface (source datastore must be dynamic in model)
    7. Using OSCommand component move file with #FILE_NAME to /completed directory.
    8. Using and ODI Procedure delete row with #MAX_ROW_NUMBER from filelist table
    9. Increment value of #MAX_ROW_NUMBER by -1
    10. GO TO 4

    Optional step, you can KO from step 4 to another OSCommand which deletes the filelist.txt

    I hope, I could explain my process clearly, in case of further help do not hesitate to ask.