Wednesday, October 26, 2011

Useful Scenario

I have a source table like,
Empno   ename              sal
-------   ----------       ----------
7001       kumar               0
7499       allen                2000
7521       ward               1250
7654       martin            1250
7698       blake               2850
7782       clark                2450
7839       king                 6000
7844       turner             1500
7900       james              950
7934       miller              2000
        Now my target table should look like,
Empno     ename      sal                 prevsal
-------     --------   ------        ----------
7001         kumar       0                   null
7499         allen         2000               0
7521         ward        1250               2000
7654         martin     1250              1250
7698         blake        2850             1250
7782         clark         2450             2850
7839          king         6000             2450
7844          turner     1500             6000
7900          james      950               1500
7934          miller       2000            950

Solution:

                                       Using 'lag' function in oracle, we can achieve this easily.Design The mapping as shown in the above image.And Write the sql query in the source qualifier as follows,
Select
Emp.empno,
Emp.ename,
Emp.sal,
Lag(emp.sal,1) over(order by emp.sal) as prevsal
From
Emp
This will bring our desired output.

Friday, October 21, 2011

Retain Multiple Sessions

            when we execute the same workflow multiple times , session logs are getting Updated and replaced with the existing logs.
              But You can set sessions to retain Multiple log files according to the following Methods.
1. Save session log for these runs                        
               Go to-->Session-->Config Object-->Save session log for these runs (Default is 0 )
                             The Integration Service creates a designated number of session log files. Configure the number of session logs in the Save Session Log for These Runs option.

2.Save session log by
               Go to-->Session-->Config Object-->Save session log by-->Session timeStamp

3.Workflow Manager

              1.Open the Workflow Manager.
              2.Select Tasks > Session Configuration > Edit
              3.Click the Properties tab.
              4.For Save Session log by select Session runs or Session timestamp from the list
              5.Optional. If you selected Session runs in step 4, enter a numeric value for the Save session log for these runs attribute:

 
4.$PMSessionLogCount Integration Service Variable
You can also use the $PMSessionLogCount service variable to create the configured number of session logs for the Integration Service.
1. Go to Administration Console.
2. Go to the Integration Service-> Properties->
3. Set the value $PMSessionLogCount.In this example it is set to 2 which will keep a history of 3 (2+1) log files.