ethrbunny has asked for the wisdom of the Perl Monks concerning the following question:
use DBI; my $dbh; open_db_conn(); my @active_homes = get_active_homes(); $dbh->disconnect(); sub open_db_conn { my $dbd = "mysql"; my $host = "host_name"; my $db_name = "db_name"; my $user = "login"; my $password = "pass"; my $dsn = "DBI:$dbd:$db_name:$host"; eval { $dbh = DBI->connect( $dsn, $user, $password, { RaiseError => 1, AutoCommit => 0 } ); }; print "Could not open database connection: $@" if $@; } # &open_db_conn # Get active homes. # sub get_active_homes { my $sth = $dbh->prepare( qq{ call myProc() } ); $sth->execute(); print "Trouble with database connection: $@" if $@; } # &get_active_homes
cpan[1]> i DBD::mysql CPAN: Storable loaded ok Going to read /u/user/.cpan/Metadata Database was generated on Wed, 13 Jun 2007 03:07:59 GMT Strange distribution name [DBD::mysql] Bundle Bundle::DBD::mysql (CAPTTOFU/DBD-mysql-4.005.tar.gz) Module DBD::mysql (CAPTTOFU/DBD-mysql-4.005.tar.gz) 2 items found cpan[2]> i DBI Strange distribution name [DBI] Bundle Bundle::DBI (TIMB/DBI-1.56.tar.gz) Module DBI (TIMB/DBI-1.56.tar.gz) 2 items found
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: problem calling MySQL stored proc
by PreferredUserName (Pilgrim) on Jun 14, 2007 at 14:35 UTC | |
|
Re: problem calling MySQL stored proc
by andreas1234567 (Vicar) on Jun 14, 2007 at 20:20 UTC | |
|
Re: problem calling MySQL stored proc
by naikonta (Curate) on Jun 14, 2007 at 14:37 UTC | |
|
Re: problem calling MySQL stored proc
by andreas1234567 (Vicar) on Jun 14, 2007 at 15:41 UTC | |
by ethrbunny (Monk) on Jun 14, 2007 at 16:23 UTC | |
|
Re: problem calling MySQL stored proc
by kwaping (Priest) on Jun 14, 2007 at 17:06 UTC |