944,137 Members | Top Members by Rank

Ad:
  • MySQL Discussion Thread
  • Unsolved
  • Views: 2132
  • MySQL RSS
May 28th, 2007
0

help on error handling in mysql ,in primary key

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
krthk_sg is offline Offline
1 posts
since May 2007
Jun 14th, 2007
0

Re: help on error handling in mysql ,in primary key

I have no idea what you're asking, sorry.
Reputation Points: 31
Solved Threads: 1
Junior Poster in Training
leelee is offline Offline
76 posts
since Aug 2005
Jun 15th, 2007
0

Re: help on error handling in mysql ,in primary key

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.
Reputation Points: 37
Solved Threads: 0
Newbie Poster
tinamary is offline Offline
16 posts
since May 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MySQL Forum Timeline: help wif uploading My sql database into Phpmyadmin.com
Next Thread in MySQL Forum Timeline: How to count sum of values in the table?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC