First of all, I am a complete beginner here.  I've only learned about mysql
within the last week and I've only been coding in perl for about a month.  I
only mention this because I still need explanations to be very simple.

I have created a database for a very large file we have.  I currently have
two tables with two fields
   GI           SPECIES
   gi#KEY       taxid#KEY
   taxid#       name

The taxid's are the same and I've created a program to check for new entries
that need to be added to this file.  When it finds them I'm attempting to
run this bit of script from my program:

$rows = $dbh->do("INSERT GI (gi, taxid)". " VALUES('$gi','$taxid')");
$rows = $dbh->do("INSERT Species (taxid, name)". "
VALUES('$taxid','$Species')");

However, even though this shouldn't happen I have found the occasional case
of an entry in the GI table without and entry in the SPECIES table so when I
do a check earlier against both I've returned an empty set but when I try
the first INSERT I get the error:

DBD::mysql::db do failed: Duplicate entry '15888067' for key 1 at testDB.pl
line 35.

It then quits the program entirely.  I have been unable to find a way to
stop it from exiting the program and capturing this error so I can deal with
it within my script.


Thanks for any and all help!!
Sarah Killcoyne


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to