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
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to