This is a discussion on multiple compare within the MySQL Database forums, part of the Database Forums category; Hi, I need to check a set of links against a large database that I have created. As the links ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi,
I need to check a set of links against a large database that I have created. As the links get added I check one by one that they don't get added twice. I was wondering if it is possible to pass the entire SET of links to be checked all at once instead of one by one. I am hoping this will make my application run fast. Thanks Carl |
|
|||
|
>I need to check a set of links against a large database that I have
>created. As the links get added I check one by one that they don't get >added twice. A unique index on that field will prevent entering the same link twice, without needing to run a separate query to check first. >I was wondering if it is possible to pass the entire SET >of links to be checked all at once instead of one by one. I am hoping >this will make my application run fast. If you use INSERT with multiple records and get an error about a duplicate record, you may not know which record is the duplicate. |
|
|||
|
Thanks Gordon, I was wondering if a column could be made unique. I looked into altering the column to unique that I am using but I have been having problems. Could you give me a hint as to how I could do this or should I just recreate the table with the column being unique. Thanks, Carl On Mar 4, 6:40 pm, gordonb.n6...@burditt.org (Gordon Burditt) wrote: > >I need to check a set of links against a large database that I have > >created. As the links get added I check one by one that they don't get > >added twice. > > A unique index on that field will prevent entering the same link twice, > without needing to run a separate query to check first. > > >I was wondering if it is possible to pass the entire SET > >of links to be checked all at once instead of one by one. I am hoping > >this will make my application run fast. > > If you use INSERT with multiple records and get an error about a > duplicate record, you may not know which record is the duplicate. |
|
|||
|
carlbernardi@gmail.com <carlbernardi@gmail.com> wrote:
> I was wondering if a column could be made unique. I looked into > altering the column to unique that I am using but I have been having > problems. Could you give me a hint as to how I could do this or > should I just recreate the table with the column being unique. ALTER TABLE tablename ADD UNIQUE (fieldname); If there are already duplicates, you might want to remove them first. -- Rik Wasmus |