help on error handling in mysql ,in primary key

Reply

Join Date: May 2007
Posts: 1
Reputation: krthk_sg is an unknown quantity at this point 
Solved Threads: 0
krthk_sg krthk_sg is offline Offline
Newbie Poster

help on error handling in mysql ,in primary key

 
0
  #1
May 28th, 2007
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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 76
Reputation: leelee is an unknown quantity at this point 
Solved Threads: 1
leelee leelee is offline Offline
Junior Poster in Training

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

 
0
  #2
Jun 14th, 2007
I have no idea what you're asking, sorry.
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 16
Reputation: tinamary is an unknown quantity at this point 
Solved Threads: 0
tinamary tinamary is offline Offline
Newbie Poster

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

 
0
  #3
Jun 15th, 2007
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC