Skip to content
Snippets Groups Projects
Commit fdfac377 authored by Daniel Rios's avatar Daniel Rios
Browse files

modified LIMIT to use a function from DBConnection

parent fc198f11
No related branches found
No related tags found
No related merge requests found
......@@ -556,15 +556,11 @@ sub _lookup_version {
if( ! defined $arch_id->{'db_name'} ) {
# latest version of this stable id
$sql = qq(
SELECT new_db_name, new_version
FROM stable_id_event sie, mapping_session m
WHERE sie.mapping_session_id = m.mapping_session_id
AND new_stable_id = "@{[$arch_id->stable_id]}"
$EXTRA_SQL
ORDER BY m.created DESC
LIMIT 1);
my $sql_tmp = "SELECT new_db_name, new_version ";
$sql_tmp .= "FROM stable_id_event sie, mapping_session m ";
$sql_tmp .= "WHERE sie.mapping_session_id = m.mapping_session_id AND new_stable_id = \"@{[$arch_id->stable_id]}\" $EXTRA_SQL ";
$sql_tmp .= "ORDER BY m.created DESC";
$sql = $self->dbc->add_limit_clause($sql_tmp,1);
} else {
$sql = qq(
SELECT old_db_name, old_version
......
......@@ -874,7 +874,7 @@ sub get_taxonomy_id {
Description : Retrieves the species scientific name (Genus species) from the
meta table
Return type : String - species scientific name
Exceptions : thrown if species name can't be determined from db
Exceptions : thrown if species name can not be determined from db
Caller : general
=cut
......@@ -882,15 +882,17 @@ sub get_taxonomy_id {
sub get_species_scientific_name {
my ($self, $dba) = @_;
$dba ||= $self->dba;
my $sql = qq(
SELECT
meta_value
FROM
meta
WHERE meta_key = "species.classification"
ORDER BY meta_id
LIMIT 2
);
my $sql_tmp = "SELECT meta_value FROM meta WHERE meta_key = \'species.classification\' ORDER BY meta_id";
my $sql = $dba->dbc->add_limit_clause($sql_tmp,2);
# my $sql = qq(
# SELECT
# meta_value
# FROM
# meta
# WHERE meta_key = "species.classification"
# ORDER BY meta_id
# LIMIT 2
# );
my $sth = $dba->dbc->db_handle->prepare($sql);
$sth->execute;
my @sp;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment