Sequence generator is a Passive and Connected transformation, and it generates numeric sequence values such as 1,2,3, and so on. It does not affect the number of input rows.
The sequence generator transformation is used to create unique primary key values and replace missing primary keys.
Procedure:-
- Open SQL server and check the source table src_employees_d by giving the select statement.
- Login to IICS and Click on new mapping.
- Click on create to create new mapping and rename the mapping of your choice for example:- m_alternate_records_sequence
- Click on the Source and rename the source name as required.
- In the properties go to Source and configure the connections by selecting the required connection name.
- In the Object select the source object and click on ok.
- In the source properties click on preview to preview the data
- Drag the Sequence transformation from the left side of design menu and select the transformation.
- Rename the sequence transformation.
- Click on the sequence specify the sequence properties as required.
- In the properties click on the Advanced and disable the incoming fields.
- Go to properties click on generated fields here both the fields has been generated i.e NEXTVAL and CURRVAL.
- the router transformation from the left side of design menu and select the transformation. rename the transformation.
- In the properties click on the output groups give the condition as follows.
- Here we need to drag 2 targets 1 for the even records and 1 target for the odd records as we will be loading alternate records.
- Click on the 1st target and rename the target as tgt_EVEN.
- In the properties click on target and configure the target connections.
- In the target object click on the existing and select the created target i.e. tgt_even_d1 and click on ok.
- In the properties click on the field mapping and click on Automap and select the smart map as it will map all the fields.
- Click on the 2nd target and rename the target and in the properties click on the target and configure the target connections.
- click on the select and select Existing and click on the created 2nd target i.e. tgt_odd_d1 and click on ok.
- In the properties click on the field mapping and select smart map from Automap then all the incoming fields are mapped with the target fields.
- Click on save to save the mapping.
- Click on new to create the mapping task and give the proper task name and specify the Run time environment.
- Click on select and select the mapping from the mapping list as shown below.
- Click on next and click on Finish.
- Click on Run to run the mapping task.
- Go to My jobs and check the status.
- Check the output in oracle SQL developer HR data base. here in the 1st target we can see even records of EMPLOYEE_ID from the target table i.e.
Tgt_even_d1.
- Here in the 2nd target table we can see odd records of EMPLOYEE_ID from the target table i.e.tgt_odd_d1.