Did you install the DBI module?

 

I have found that if you need to run your program for an extended period of time and need to reconnect to your DB, Win32::ODBC has a memory leak that can cause you problems.

 

Howard A. Bullock
Computer Security
Tyco Electronics
717-810-3584


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ted Yu
Sent: Tuesday, June 14, 2005 2:43 AM
To: [email protected]
Subject: Use DBI; vs. use Win32::ODBC;

 

I recently wanted to use the following code for a select statement:

 

use DBI;
my $dbh = DBI->connect( "dbi:ODBC:{database}","{username}", "{password}")
    or &error('CONNECT_SQL');

my $results = $dbh->selectall_arrayref('select count(*) from tblTicketFileProcessLog');

print $results;use DBI;
my $dbh = DBI->connect( "dbi:ODBC:{database}","{username}", "{password}")
    or &error('CONNECT_SQL');

my $results = $dbh->selectall_arrayref('select count(*) from tblTicketFileProcessLog');

print $results;

 

Not sure what use DBI is, but I'm use to using Win32:ODBC.  What's the difference, and is there a way for me to do the same thing with Win32:ODBC?  I keep getting an error that reads:

 

Can't locate DBI.pm in @INC...

 

What would be the code if i used Win32:ODBC?  The result of the select statement is a single value and not an array.  Appreciate your help, as I am new to using remote connections to a SQL database with Perl.

 

Ted

 

 

_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to