Change Large Number of Record Keys using Map Table
- by Coyote
I have a set of records indexed by id numbers, I need to convert these record's indexes to a new id number. I have a two column table mapping the old numbers to the new numbers.
For example given these two tables, what would the update statement look like?
Given:
OLD_TO_NEW
oldid | newid
-----------------
1234 0987
7698 5645
... ...
and
id | data
----------------
1234 'yo'
7698 'hey'
... ...
Need:
id | data
----------------
0987 'yo'
5645 'hey'
... ...
This oracle so I have access to PL/SQL, I'm just trying to avoid it.