User defined SQL not working for update
Posted: Tue Feb 03, 2009 3:27 am
Hi All,
I am trying to update a table using the userdefined query...
UPDATE Table SET col4= ? WHERE (col2=? And Col3=?)
Message: 0 rows affected...
The columns in the where clause are not the key column in database...but in datastage i enabled it as key..even in the where clause if i add primary key along with that...it is not getting updated.
But the update query works if i give the query in this way..
Update table set col1=?, col2=? col3=? and col4=? where (col1=?)
col1 - is the actual primary key of the table in database.
But i dont want to update col1, col2, col3...i really want to update only col4 based on col2 and col3...
Why am getting this problem..please let me know.
Thanks,
Senthil P
**Note: Subject changed to be more descriptive - Content Editor **
I am trying to update a table using the userdefined query...
UPDATE Table SET col4= ? WHERE (col2=? And Col3=?)
Message: 0 rows affected...
The columns in the where clause are not the key column in database...but in datastage i enabled it as key..even in the where clause if i add primary key along with that...it is not getting updated.
But the update query works if i give the query in this way..
Update table set col1=?, col2=? col3=? and col4=? where (col1=?)
col1 - is the actual primary key of the table in database.
But i dont want to update col1, col2, col3...i really want to update only col4 based on col2 and col3...
Why am getting this problem..please let me know.
Thanks,
Senthil P
**Note: Subject changed to be more descriptive - Content Editor **