Skip to content
Snippets Groups Projects
Commit 692b4494 authored by Graham McVicker's avatar Graham McVicker
Browse files

db->prepare() => db->dbc()->prepare()

parent 8ef93d46
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@ my $db = new Bio::EnsEMBL::DBSQL::DBAdaptor(-host => $host,
-pass => $pass,
-dbname => $dbname);
my $sth = $db->prepare( "select count(*) from gene" );
my $sth = $db->dbc()->prepare( "select count(*) from gene" );
$sth->execute();
my ( $gene_count ) = $sth->fetchrow_array();
......@@ -48,7 +48,7 @@ if( ! $gene_count ) {
# Could be database without seq_regions
# Then have to try and attach core db
#
$sth = $db->prepare( "select count(*) from seq_region" );
$sth = $db->dbc()->prepare( "select count(*) from seq_region" );
$sth->execute();
my ( $seq_region_count ) = $sth->fetchrow_array();
if( ! $seq_region_count ) {
......
......@@ -43,7 +43,7 @@ my $small_blocksize = 500;
#
# Check wether the script should run on given database
#
my $sth = $db->prepare( "select count(*) from dna" );
my $sth = $db->dbc->prepare( "select count(*) from dna" );
$sth->execute();
my ( $dna_count ) = $sth->fetchrow_array();
if( ! $dna_count ) {
......
......@@ -38,7 +38,7 @@ my $db = new Bio::EnsEMBL::DBSQL::DBAdaptor(-host => $host,
my $sth = $db->prepare( "select count(*) from repeat_feature" );
my $sth = $db->dbc()->prepare( "select count(*) from repeat_feature" );
$sth->execute();
my ( $repeat_count ) = $sth->fetchrow_array();
......
......@@ -33,7 +33,7 @@ $genestats = $snpstats = 1 if(!$genestats && !$snpstats);
my $genes_present;
if($genestats) {
my $sth = $db->prepare( "select count(*) from gene" );
my $sth = $db->dbc()->prepare( "select count(*) from gene" );
$sth->execute();
my ( $gene_count ) = $sth->fetchrow_array();
......@@ -46,7 +46,7 @@ if($genestats) {
#
# and seq_regions
#
my $sth = $db->prepare( "select count(*) from seq_region" );
my $sth = $db->dbc()->prepare( "select count(*) from seq_region" );
$sth->execute();
my ( $seq_region_count ) = $sth->fetchrow_array();
if( ! $seq_region_count ) {
......@@ -146,7 +146,7 @@ sub lite_attach {
#
# get a lost of all databases on that server
#
my $sth = $db->prepare( "show databases" );
my $sth = $db->dbc()->prepare( "show databases" );
$sth->execute();
my $all_db_names = $sth->fetchall_arrayref();
my %all_db_names = map {( $_->[0] , 1)} @$all_db_names;
......
......@@ -137,7 +137,7 @@ sub lite_attach {
#
# get a lost of all databases on that server
#
my $sth = $db->prepare( "show databases" );
my $sth = $db->dbc->prepare( "show databases" );
$sth->execute();
my $all_db_names = $sth->fetchall_arrayref();
my %all_db_names = map {( $_->[0] , 1)} @$all_db_names;
......
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