Using table names that run in all contexts using getObjectName
Since it's usually beneficial to avoid hard-coding fully qualified schema and object names (doing so can create issues when migrating
code between environments), we will often want to employ a simple technique that uses one of the out of the box ODI substitution methods: odiRef.getObjectName.odiRef.getObjectName
. This particular method can resolve and return the complete object name for a specified table depending on the context in which the application is currently running. In this recipe, we will examine some of the details of how ODI can resolve a complete database table name using only a base object name.
Getting ready
All references to tables in this recipe are taken from the data samples described in the preface of this book. Be sure to reverse engineer the DEMO_SRC
and DEMO_TRG
data models before beginning this recipe.
How to do it...
Within a folder of your choosing, insert a new variable called
PV_TABLE_CNT.
Set the Datatype...