I see Hilmar has given you a lot of information. Just as an aside, you should never ever get a duplicate primary key. A primary key should be a surrogate key in that it has no business meaning and so the system should be generating the keys for you (whether your own generation code or an Autoinc field).
For candidate keys, you need to check the rest of the data to see if the candidate key already exists before trying to save (but I would still trap for the error when saving anyhow).
>OK
>
>I created the primary key
>
>Now how can I check it by the time I do my tableupdate () ?