Professional Web Applications Themes

multiple compare - MySQL

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...

  1. #1

    Default multiple compare

    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

    carlbernardi@gmail.com Guest

  2. #2

    Default Re: multiple compare

    >I need to check a set of links against a large database that I have 

    A unique index on that field will prevent entering the same link twice,
    without needing to run a separate query to check first.
     

    If you use INSERT with multiple records and get an error about a
    duplicate record, you may not know which record is the duplicate.


    Gordon Guest

  3. #3

    Default multiple compare

    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

    carlbernardi@gmail.com Guest

  4. #4

    Default Re: multiple compare

    com wrote: 

    Carl,

    You can check them all at once - but I agree with Gordon. A Unique
    Index on the column will ensure you have no duplicates.

    That's part of its purpose.


    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    net
    ==================
    Jerry Guest

  5. #5

    Default Re: multiple compare


    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, org (Gordon Burditt) wrote: 
    >
    > A unique index on that field will prevent entering the same link twice,
    > without needing to run a separate query to check first.

    >
    > If you use INSERT with multiple records and get an error about a
    > duplicate record, you may not know which record is the duplicate.[/ref]


    carlbernardi@gmail.com Guest

  6. #6

    Default Re: multiple compare

    com <com> wrote: 

    ALTER TABLE tablename ADD UNIQUE (fieldname);

    If there are already duplicates, you might want to remove them first.
    --
    Rik Wasmus
    Rik Guest

Similar Threads

  1. Compare two PDF's in .NET using Acrobat SDK
    By attaboy in forum ASP.NET
    Replies: 5
    Last Post: September 13th, 02:15 AM
  2. Compare 2 PDF
    By Claus_Allgeier@adobeforums.com in forum Adobe Acrobat SDK
    Replies: 2
    Last Post: December 10th, 02:08 PM
  3. compare
    By Piet in forum MySQL
    Replies: 3
    Last Post: April 9th, 01:57 AM
  4. Compare dates
    By Shaun in forum PHP Development
    Replies: 2
    Last Post: September 29th, 12:24 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139