in reply to How do I avoid inserting duplicate numbers into an Access table?
Some tips:
You can replace:
with:while ($count<=@IDnumber) { if ($match == $IDnumber[$count]){ goto NEXTLINE1; } $count++; }
and you don't really need the label/goto, the command 'next' does exactly that, ie jump back to the top of the loop and start the next iteration.next if(grep {$_ eq $match} @IDnumber);
As to the IDs, first, you should probably check the current values in the table, to see if the one you want to insert is present, assuming there are any. But a much easier way to do this would be to make the field in the table unique ('no duplicates', in Access), in which case it will simply refuse to insert that line, and you can carry on to the next.
C.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How do I avoid inserting duplicate numbers into an Access table?
by Anonymous Monk on Mar 06, 2004 at 18:44 UTC | |
by bmann (Priest) on Mar 06, 2004 at 20:02 UTC | |
by Anonymous Monk on Mar 07, 2004 at 06:19 UTC |