in reply to $sth->execute error

Short Answer:

$sth->execute()

Long Answer:

Wanna bet most of those variables don't contain SQL literals?

my $sql = " insert into BiscHet ( pdbAndChainID1, asaSingle1, asaComplex1, organismPdb1, taxidPdb1, scopClass1, scopFold1, scopSuperfamily1, scopFamily1, intactID1, evalue1, length1, identity1, organismIntact1, taxidIntact1, pdbAndChainID2, asaSingle2, asaComplex2, organismPdb2, taxidPdb2, scopClass2, scopFold2, scopSuperfamily2, scopFamily2, intactID2, evalue2, length2, identity2, organismIntact2, taxidIntact2, sequenceAtom2, sequenceSeqRes2, jmolSelect, interface ) VALUES (".join(',', ('?')x34 ).") " my $sth = $dbh->prepare($sql) or die $dbh->errstr; $sth->execute( $id1, $asaSingleC1, $asaComplexC1, $organismC1, $taxidC1, $scopClassC1, $scopFoldC1, $scopSuperfamilyC1, $scopFamilyC1, $uniprotID1, $evalue1, $length1, $identity1, $organismIntAct1, $taxidIntAct1, $id2, $asaSingleC2, $asaComplexC2, $organismC2, $taxidC2, $scopClassC2, $scopFoldC2, $scopSuperfamilyC2, $scopFamilyC2, $uniprotID2, $evalue2, $length2, $identity2, $organismIntAct2, $taxidIntAct2, 'ATCGT', 'GATAT', 'NA', 'interface' ) or die $dbh->errstr; $sth->finish();

Finally, the presence of fields X1 and X2 is usually a sign of a bad database design, and here is no exception.

Replies are listed 'Best First'.
Re^2: $sth->execute error
by RobertCraven (Sexton) on Feb 14, 2009 at 06:28 UTC
    Thanks, that worked!

    Beside the fields evalue1 & evalue2 the variables are either integer or text.
    The design of database is very bad. It runs in a virtual machine on NFS. Every join takes ages, so now the attempt to have all data in one table.
      NFS and virtual machine is not necessarily bad. I would check your indexes though (make sure the columns you join on are indexed and your where clauses are too).