Problem while using stage variables
Posted: Wed Oct 11, 2006 1:50 am
I am working on PX and facing a problem with the use of stage variables.
In my job i am having 3 flows: One for Insert,One for Update and one for Delete.In case of insertion and updation i am using some stage variables to populate the target columns.These stage variables are common for both insertion and updation operations.In case of insertion its working fine but in case of Updation i am getting problem.The problem is as follows:
Target table has 4 columns:
Col1(Integer,PK) COl2(varchar) Col3(timestamp) Col4(Decimal)
In the first run i am inserting the followong data into the table:
Col1 COl2 Col3 Col4
1 A 10-Oct-2006 1.0
2 B 11-Oct-2006 2.0
3 C 11-Oct-2006 3.0
4 D 11-Oct-2006 4.0
In the second run i am trying to update these records with the following values:
Record1 COl2 update from A to Z
Record2 COl2 Update from B to Null,Col3 update from 11-Oct-2006 to Null
Record2 Col4 update from 3 to NUll
So my target table should look like:
Col1 COl2 Col3 Col4
1 Z 10-Oct-2006 1.0
2 NULL NULL 2.0
3 C 11-Oct-2006 NULL
But my actual view of the table is
Col1 COl2 Col3 Col4
1 Z 10-Oct-2006 1.0
2 Z 10-Oct-2006 2.0
3 C 11-Oct-2006 2.0
4 D 11-Oct-2006 4.0
So you can say where ever i am putting a NULL in the target column it is getting populated with the previous records value which were not NULL.
There is no such problem if i am not using any stage variables and calculating the columns in their derivations only.
Can any one please guide me on this?
Thanks alot in advance.
In my job i am having 3 flows: One for Insert,One for Update and one for Delete.In case of insertion and updation i am using some stage variables to populate the target columns.These stage variables are common for both insertion and updation operations.In case of insertion its working fine but in case of Updation i am getting problem.The problem is as follows:
Target table has 4 columns:
Col1(Integer,PK) COl2(varchar) Col3(timestamp) Col4(Decimal)
In the first run i am inserting the followong data into the table:
Col1 COl2 Col3 Col4
1 A 10-Oct-2006 1.0
2 B 11-Oct-2006 2.0
3 C 11-Oct-2006 3.0
4 D 11-Oct-2006 4.0
In the second run i am trying to update these records with the following values:
Record1 COl2 update from A to Z
Record2 COl2 Update from B to Null,Col3 update from 11-Oct-2006 to Null
Record2 Col4 update from 3 to NUll
So my target table should look like:
Col1 COl2 Col3 Col4
1 Z 10-Oct-2006 1.0
2 NULL NULL 2.0
3 C 11-Oct-2006 NULL
But my actual view of the table is
Col1 COl2 Col3 Col4
1 Z 10-Oct-2006 1.0
2 Z 10-Oct-2006 2.0
3 C 11-Oct-2006 2.0
4 D 11-Oct-2006 4.0
So you can say where ever i am putting a NULL in the target column it is getting populated with the previous records value which were not NULL.
There is no such problem if i am not using any stage variables and calculating the columns in their derivations only.
Can any one please guide me on this?
Thanks alot in advance.