lundi 30 novembre 2015

how to update primary key with violating values

say i have table collection, with primary key (col_id, item_id). item_id is a value which ideally should come from server mapping, but until that value is generated from server, we use a local unique value. however, upon mapping, there are possibility that multiple local_ids match with single remote_id. now I want to update those value in table, but that would fail the primary key constraint. how this can be achieved while keeping position of at least 1 item intact (i don't want to remove and add at the end)

Aucun commentaire:

Enregistrer un commentaire