[BioSQL-l] how do you update the value of a tag?
Frederic Pecqueur
Frederic.Pecqueur at devgen.com
Mon Nov 24 11:05:02 EST 2003
Hi,
I have a problem when I want update the value of a tag in a Sequence of BioSQL.
I use this code :
my $adp = $db->get_object_adaptor('Bio::SeqI');
my $lseq = $adp->find_by_unique_key(Bio::Seq::RichSeq->new(
-accession_number => $id,
-namespace => $namespace
));
my $source;
foreach my $feat ( $lseq->get_SeqFeatures )
{
if ( $feat->primary_tag eq 'gene' )
{
$source = $feat;
last;
}
}
$source->remove_tag('standard_name');
$source->add_tag_value('standard_name','my new value');
$source->store();
Apparently the problem comes from the update of the "Seqfeature Qualifier Value" table.
I obtain several errors about a bad insert command.
I don't understand why the API uses an "INSERT" command and not an "UPDATE" command??
Here is the errors:
DBD::Oracle::st execute failed: ORA-00001: unique constraint (BIOSQL.XPKSEQFEATURE_QUALIFIER_ASSOC) violated (DBD ERROR: OCIStmtExecute) [for statement ``INSERT INTO seqfeature_qualifier_value (fea_oid, trm_oid, value, rank) VALUES (?, ?, ?, ?)'' with params: :p4=1, :p1='5321562', :p2=1968, :p3='a new value']) at usr/lib/perl5/site_perl/5.6.1/Bio/DB/BioSQL/BasePersistenceAdaptor.pm line 418.
somebody has an idea?
Thanks a lot.
Frédéric.
More information about the BioSQL-l
mailing list