07-02-2008
My impression is that you need to disconnect and reconnect. But why are you doing this? Unless you really have a lot of databases, opening all of the connections you need at the beginning and just close them all at the end should do it ....
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
We ran into an issue trying to install DBI and DB2 modules for perl for AIX from the link
http://www-306.ibm.com/software/data/db2/perl/
We tried to install the DBI module using
bash# perl -MCPAN -e 'install DBI'
command. However we ended up with the following error.
Stop.
... (3 Replies)
Discussion started by: jerardfjay
3 Replies
2. Shell Programming and Scripting
how to disable the contraint type of a field (which is present in diffrent tables ) in database using a single unix script file. (4 Replies)
Discussion started by: shaksing
4 Replies
3. Programming
hi i am trying to connect to an oracle database using dbi and i get this ::
Driver has not implemented the disconnect_all method. at /opt/perl/lib/site_perl/5.8.0/sun4-solaris/DBI.pm line 575
END failed--call queue aborted.
for all i know, the script was working earlier, but has... (1 Reply)
Discussion started by: poggendroff
1 Replies
4. Programming
Hello. I am taking a Perl class in college and we've briefly covered SQL and moved on. We have a term project and we can do whatever we want. My project will rely strongly on an SQL Database so I am trying to learn as much about Perl DBI as I can to get things up and going.
I am basically... (1 Reply)
Discussion started by: Dave247
1 Replies
5. Shell Programming and Scripting
Hi,
I want to connect perl with the mysql to select and so on but the connection don't work
code
#!/usr/bin/perl
BEGIN {
# PERL MODULES WE WILL BE USING
use DBI;
$dbh = DBI->connect('DBI:mysql:C:\Program Files\MySQL\MySQL Server 5.0\data\db1','','pass') or die $DBI::errstr;}
#... (1 Reply)
Discussion started by: eng_shimaa
1 Replies
6. UNIX for Advanced & Expert Users
i've been struggling with installing the Perl DBI & DBD modules all weekend, and I'm getting close, but no cigar as of yet. When I run the perl script db.pl I get the following mismatch error:
Mon Apr 19 09:43:29 EDT 2010
/Library/Perl/DBD-mysql-4.011 ->
peterv@MBP17.local<515>$: db.pl | tee... (0 Replies)
Discussion started by: peterv6
0 Replies
7. Shell Programming and Scripting
Hi there, I have a bit of code similar to below (which ive actually got from perldoc, but mine is similar enough)
$sth = $dbh->prepare(q{ SELECT region, sales FROM sales_by_region });
$sth->execute;
my ($region, $sales);
# Bind Perl variables to columns:
$rv =... (4 Replies)
Discussion started by: hcclnoodles
4 Replies
8. Shell Programming and Scripting
Hi All,
I installed DBI module in a non INC location and using it in my script via "use lib".
But it throw the below error at the "use DBI" step.
Please help
Usage: DBI::_install_method(dbi_class, meth_name, file, attribs=Nullsv) at /xx/xxx/xxxxx/xxxxx/oracle/lib/DBI.pm/oracle/lib/DBI.pm line... (2 Replies)
Discussion started by: prasperl
2 Replies
9. Red Hat
my os details as follow
bash-3.2$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.8 (Tikanga)
I run the following and encounter the following error
bash-3.2$ mysqlhotcopy -?
Can't locate DBI.pm in @INC (@INC contains:... (5 Replies)
Discussion started by: jediwannabe
5 Replies
LEARN ABOUT DEBIAN
authen::simple::dbi
Authen::Simple::DBI(3pm) User Contributed Perl Documentation Authen::Simple::DBI(3pm)
NAME
Authen::Simple::DBI - Simple DBI authentication
SYNOPSIS
use Authen::Simple::DBI;
my $dbi = Authen::Simple::DBI->new(
dsn => 'dbi:SQLite:dbname=database.db',
statement => 'SELECT password FROM users WHERE username = ?'
);
if ( $dbi->authenticate( $username, $password ) ) {
# successfull authentication
}
# or as a mod_perl Authen handler
PerlModule Apache::DBI
PerlModule Authen::Simple::Apache
PerlModule Authen::Simple::DBI
PerlSetVar AuthenSimpleDBI_dsn "dbi:SQLite:dbname=database.db"
PerlSetVar AuthenSimpleDBI_statement "SELECT password FROM users WHERE username = ?"
<Location /protected>
PerlAuthenHandler Authen::Simple::DBI
AuthType Basic
AuthName "Protected Area"
Require valid-user
</Location>
DESCRIPTION
DBI authentication.
METHODS
* new
This method takes a hash of parameters. The following options are valid:
* dsn Database Source Name. Required.
dsn => 'dbi:SQLite:dbname=database.db'
dsn => 'dbi:mysql:database=database;host=localhost;'
* statement
SQL statement. The statement must take a single string argument (username) and return a single value (password). Required.
statement => 'SELECT password FROM users WHERE username = ?'
* username
Database username.
username => 'username'
* password
Database password.
password => 'secret'
* log Any object that supports "debug", "info", "error" and "warn".
log => Log::Log4perl->get_logger('Authen::Simple::DBI')
* authenticate( $username, $password )
Returns true on success and false on failure.
SEE ALSO
Authen::Simple.
Authen::Simple::Password.
DBI.
AUTHOR
Christian Hansen "ch@ngmedia.com"
COPYRIGHT
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.8.8 2008-02-29 Authen::Simple::DBI(3pm)