after INSERT fail, make UPDATE guidelines -
09-23-2008
, 02:35 AM
I think, that I have to do something wrong. In periodicaly running updates,
at the end of the transformation, I usually use OLE DB Destination and if the
INSERT fails (usually because of the PK conflict), row is redirected to the
error output and there the OLE DB Command make UPDATE of this row to the DB.
This technique working well, but!!! -> In the UPDATE command is not possible
use named parameters (I have to use UPDATE myTable SET column1 = ? WHERE
column2 = ?). In case I have tables with a few columns, that is no problem.
But I often transform data tables from the AS400 DB and there are 140 columns
with 8 primary keys and with only 8 characters in the column name. Which
means, it is very unclear (not well arranged). On one side I have columns
from AS400 DB2 named for example GLPMJ, GLGTGF, GLRUID, etc.. on other side
unnamed parameters Param_0, Param_1, Param_3. etc....
My questions are:
1) Is there way to use named parameters in the OLE DB Command?
2) Is there another way to perform update command based on keys in the
destination table??
Thanks alot for the help. |