954,135 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

help on error handling in mysql ,in primary key

hi ppl,i have a question.I have column which is a primary key.i have inserted a value also to it.Now again if i insert the same value it shouls not give a error.but instead continue.So how to go about it.like vb onerror is there any way that we can write the script in mysql or shell programming do reply quickly.

krthk_sg
Newbie Poster
1 post since May 2007
Reputation Points: 10
Solved Threads: 0
 

I have no idea what you're asking, sorry.

leelee
Junior Poster in Training
77 posts since Aug 2005
Reputation Points: 31
Solved Threads: 1
 

hi
primary keys are meant to be unique in database, if you want to insert the same value again in the column and not get errors, then you should use surrogate key.
"surrogate key is the substitution of the primary key"
so in order to include your value again in the table, please see to that the other columns , that non attribute key should have changes or which requires updatation and keep the old values in the table.
this method will not give any error for sure.

tinamary
Newbie Poster
16 posts since May 2007
Reputation Points: 37
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You