My response breaks the flow of your script for clarity, but don't take that as me suggesting to just randomly move things around :-)
On Tue, 15 Mar 2005, SG Edwards wrote: > if ($accession eq $result) { > print " the protein is already in the database\n"; > ... > print "the protein needs to be inserted into the database\n"; Nitpick: putting the variable in the print statement makes the print statment more useful: print " protein $accession is already in the database\n"; print " protein $accession must be added to the database\n"; > my $result = $dbh->selectcol_arrayref("SELECT primary_acc_no FROM > uniprot_entry_tbl WHERE primary_acc_no='P09466'"); > ... > $dbh->do("INSERT INTO uniprot_entry_tbl (primary_acc_no) > values ('$accession')"); > ... > $dbh->disconnect; It may help to add error checking code to all of this, as per this page: <http://www.oreilly.com/catalog/perldbi/chapter/ch04.html#ch04_error_0> You may already have one of these elsewhere in your code: $h->{PrintError} = 1; $h->{RaiseError} = 1; ...in which case you're way ahead of me :-) Also, are you *positive* that the PostgreSQL SQL query -- INSERT INTO uniprot_entry_tbl (primary_acc_no) VALUES ('p09466') -- is correct? Because it looks to me (and apparently to PostgreSQL) like you may have your data field being used as a column name in the query, which probably isn't correct :-) Put another way, if the SQL statement works directly against the database, such as in the `psql` interactive shell, then you should be able to use the statement in your DBI script. If it doesn't work, then it may help to see all the database sections of your code, along with file numbers so that the error output can be lined up by list readers. -- Chris Devers -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>