Page 1 of 1

oracle update option

Posted: Mon Jul 28, 2008 11:00 am
by kirankota79
I have a scenario like the following:

emplid name_type name

12345 PRI John doe
12345 PRI John King


I need to apply same conversion routine to name column, then it becomes like this

emplid name_type name

12345 PRI Kodf urt
12345 PRI Kodf fkgk



emplid and name_type are columns that i am using to update. The data is written to dataset and iam using dataset to update the same oracle table. Now how will the datastage updates the table. Does it updates with two different values or it updates to the same value?

Thanks

Posted: Mon Jul 28, 2008 4:00 pm
by ray.wurlod
It does whatever you ask it to do. But "it" here is not DataStage - DataStage simply sends the data to the database in an "UPDATE" context. If the primary key is the same, the row is the same. This is stock standard SQL behaviour - nothing at all to do with DataStage and how it works.

If the primary key consists of more than these two columns, then each update will update all rows that have these two columns with the indicated values. To update a single row you must specify the entire key (that is, all column values in the primary key).

You seem to be attempting to obfuscate data. How are you effecting the conversion - a simple character map (stage variables?) or a custom routine or buildop?

Posted: Mon Jul 28, 2008 8:04 pm
by keshav0307
you have duplicate values on the key so both the records will be updated twice with same value.