Insert and update
Moderators: chulett, rschirm, roy
Insert and update
Hi All,
I need to update or insert new rows based on key columns.
I need to do some calculation on the updated records before populating into the table.So I am taking two links from the transformer one for insert and the other for update and oci as my lookup.
I gave the condition in the constraint like IsNull(keycolumn) for insert and NotIsnull for update.
The update actions choosen from the oci are insert new rows and update existing rows respectively
But my concern is even when I am trying to populate new record it is going through the update link.
Any suggestion Please
Regards.
Saik
I need to update or insert new rows based on key columns.
I need to do some calculation on the updated records before populating into the table.So I am taking two links from the transformer one for insert and the other for update and oci as my lookup.
I gave the condition in the constraint like IsNull(keycolumn) for insert and NotIsnull for update.
The update actions choosen from the oci are insert new rows and update existing rows respectively
But my concern is even when I am trying to populate new record it is going through the update link.
Any suggestion Please
Regards.
Saik
Re: Insert and update
Is the keycolumn from the input link or the reference link. I usually differentiate between updates and inserts using the LinkVariables with the following condition in the Constraintrafidwh wrote: I gave the condition in the constraint like IsNull(keycolumn) for insert and NotIsnull for update.
Code: Select all
Updates--> InputLink.NOTFOUND <> @TRUE
Inserts--> InputLink.NOTFOUND = @TRUE
HTH
Kris
Where's the "Any" key?-Homer Simpson
Where's the "Any" key?-Homer Simpson
Re: Insert and update
The keycolumn must be from the reference link and not from the source or else it will always go down the path of Update.rafidwh wrote: I gave the condition in the constraint like IsNull(keycolumn) for insert and NotIsnull for update.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 19
- Joined: Tue Apr 26, 2005 11:41 pm
Hi
Updates--> InputLink.NOTFOUND <> @TRUE
Inserts--> InputLink.NOTFOUND = @TRUE
this will not allow in OCI reference stage, even though it shows it wont take the correct records. use IsNull for OCI stage reference.
check the constraint value in stage variable and use the stage variable in constraint.
Updates--> InputLink.NOTFOUND <> @TRUE
Inserts--> InputLink.NOTFOUND = @TRUE
this will not allow in OCI reference stage, even though it shows it wont take the correct records. use IsNull for OCI stage reference.
check the constraint value in stage variable and use the stage variable in constraint.
-
- Participant
- Posts: 232
- Joined: Fri Sep 30, 2005 4:52 am
- Contact:
Anupam - It is 8 Keys and not 8 links.sb_akarmarkar wrote:You need to give it condition for insert like InputLink1.NOTFOUND or InputLink2.NOTFOUND and ..... Upto 8 links and for Update NOT(InputLink1.NOTFOUND and InputLink2.NOTFOUND and ... Upto 8 )
above should be fine..
Thanks,
Anupam
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'