IKM Oracle Multi Table Insert
- Integrates data from one source into one to many Oracle target tables in append mode
- This IKM must be used in integration interfaces that are sequenced in a Package
- The first interface of the Package must have a temporary target and the KM option DEFINE_QUERY set to YES.
- This first interface defines the structure of the SELECT clause of the multi-table insert statement (that is the source flow).
- Subsequent integration interfaces must source from this temporary data store and have the KM option IS_TARGET_TABLE set to YES.
- The last interface of the Package must have the KM option EXECUTE set to YES in order to run the multi-table insert statement.
STEP 1 : Creating and Reverse Engineering Source
- We can use EMP table of SCOTT schema as source
- Reverse engineer EMP table into SOURCE MODEL
STEP 2 : Creating and Reverse Engineering Target
- Create Four target tables in Target Schema using below script
Create table Multi_Table_Insert_TEMP_EMP as select * from scott.emp where 1=2;
Create table Multi_Table_Insert_EMP10 as select * from scott.emp where 1=2;
Create table Multi_Table_Insert_EMP20 as select * from scott.emp where 1=2;
Create table Multi_Table_Insert_EMP30 as select * from scott.emp where 1=2;
|
- Reverse engineer into TARGET MODEL
STEP 3 : Creating First Interface
- Create interface with the name of INT_Multi_Table_Insert_TEMP_EMP
- Click on mapping tab → Drag and drop source (EMP)and target (Multi_Table_Insert_TEMP_EMP) in respective locations
- Click on flow tab
- Select IKM as IKM Oracle Multi Table Insert
- Select Define_Query = True
- Select IS_TARGET_TABLE= False
STEP 4 : Creating Second Interface
- Create interface with the name of INT_Multi_Table_Insert_EMP10
- Click on mapping tab → Drag and drop source (EMP)and target (Multi_Table_Insert_EMP10) in respective locations
- Click on flow tab
- Select IKM as IKM Oracle Multi Table Insert
- Select Define_Query = False
- Select IS_TARGET_TABLE= True
STEP 5 : Creating Third Interface
- Create interface with the name of INT_Multi_Table_Insert_EMP20
- Click on mapping tab → Drag and drop source (EMP)and target (Multi_Table_Insert_EMP20) in respective locations
- Click on flow tab
- Select IKM as IKM Oracle Multi Table Insert
- Select Define_Query = False
- Select IS_TARGET_TABLE= True
STEP 6 : Creating Fourth Interface
- Create interface with the name of INT_Multi_Table_Insert_EMP30
- Click on mapping tab → Drag and drop source (EMP)and target (Multi_Table_Insert_EMP30) in respective locations
- Click on flow tab
- Select IKM as IKM Oracle Multi Table Insert
- Select Define_Query = False
- Select IS_TARGET_TABLE= True
- Select Execute = True
STEP 7 : Create Package
- Create package with the name of pkg_Multi_Table_Insert
- Click on diagram tab → drag and drop below interfaces and connect as shown
- INT_Multi_Table_Insert_TEMP_EMP
- INT_Multi_Table_Insert_EMP10
- INT_Multi_Table_Insert_EMP20
- INT_Multi_Table_Insert_EMP30
- Run the package → observe output in three tables
No comments:
Post a Comment