简体   繁体   中英

ODI 12c Variables

I am facing difficulties in the doing the following task:

Create a table in db, which contains the file name. Read the file name from this table using variable in ODI. Read from this file and then map the content into a table Use this by creating a package.

Please help me with this.

Thank You

I have created a table in database which contains the file name.

I am assuming you are just struggling with the dynamic loading and are happy with creating the mappings etc. If not you need to work out the basics first and go through the ODI documentation and examples that are out there. Unless you understand how to build mappings, set variables and how packages work you are not going to be able to jump in the at the deep end and achieve this.

Overview

A variable is only going to be able to store one value at a time so I presuming your table will only contain a single value. If it can contain multiple files it gets more complicated as you will need to be able to pick out one value at aa time.

You will need to create a variable and set the refresh query to be something like

SELECT file_name FROM DB_TABLE WHERE rownum - 1

That variable can then be used in the resource name of the file in the ODI model.

You can then add that variable into an ODI package as a refresh step. Add you mapping into the same package and when run it will query the database to get the value and then use that as the filename when running the mapping.

Extras

The issue you are likely to have is that you need define the file structure in the ODI model. If this is a fixed format then you are OK as you can just create all the fields and metadata as needed. If the structure if fluid then this really doesn't fit easily into ODI and is really difficult to achieve.

If your aim is actually to have a dynamic filename and you are using load plans then you don't need a package at all (indeed it just adds more complexity) you can simply set the resource name to the variable, add the variable to your load plan and ensure it is refreshed before the mapping runs and the result would be the same as above

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM