Updating single values from one row to another
470360Oct 28 2008 — edited Oct 29 2008Dear everyone
How I can copy just one single value from one row to another existing row, where although the row already exists, the value does not. I know how to update columns using other columns and how to update a table using aliases to create two virtual copies. However I cannot figure out how to do it for single values.
I have
1. a list of street names in one column: name_of_feature;
2. a map index id number which is a unique id for each name: map_index_id;
3. an original map publication id number: original_publication_id;
4. geographical_coordinates column: geographical_coordinates
Having digitised over a raster map I now need to copy values from the geographical_coordinates column, for certain feature names, to other rows in the table with the same name or in some cases a user entered id number because the name has changed.
So it would work like this.
I enter a feature_name that needs updating (or id number if running the id script).
I enter the original_map_publication_id number so it knows which map is to be updated.
Then I enter the map_index_id for row where the geographical_coordinate for that feature name are already stored.
Then Oracle copies the single geographical_coordinate value to the row, without copying the rest of the row as well.
Then once that is done I run it again for another feature name or id number, depending on which script I am running.
I need to update value by value because I am checking maps whilst I do this and in some cases this will lead to further digitising instead of copying existing values.
I would be grateful for any advice or pointers to where I can find such advice. I looked in the Oracle SQL manual but could only find the parts relating to updating of complete columns or rows.
Kind regards
Tim