Hi,
I have two tables (A & B), From table A I need to take the values from a few fields from each record and use these values to look up a record on table B. With The matching record on table B I take the values from a few fields and use these values to update some fields on table A. I'm doing this from pl/sql with cursors but its taking ages, not sure how to do this in a simple update statment with joins. When I write a select statment using the join it returns in seconds but can't find a way to include this in an update. e.g.
update table A a, B b set a.col1 = b.col1,
a.col2 = b.col2
where a.col3 = b.col3
and a.col4 = b.col4
that code is rubbish but it might give you an idea what I'm trying to accomplish. Clear as Mud???
Thanks for the help
I have two tables (A & B), From table A I need to take the values from a few fields from each record and use these values to look up a record on table B. With The matching record on table B I take the values from a few fields and use these values to update some fields on table A. I'm doing this from pl/sql with cursors but its taking ages, not sure how to do this in a simple update statment with joins. When I write a select statment using the join it returns in seconds but can't find a way to include this in an update. e.g.
update table A a, B b set a.col1 = b.col1,
a.col2 = b.col2
where a.col3 = b.col3
and a.col4 = b.col4
that code is rubbish but it might give you an idea what I'm trying to accomplish. Clear as Mud???
Thanks for the help