Hello list,

My program reads the data from the table and prints it out just fine.  The problem is it prints a warning on every other line that I have an uninitialized value in the string at line 22.  I put #### at the beginning and end of the code it is talking about.  I can’t figure out what is causing this.

Any help is much appreciated.

Eric

 

#!/usr/bin/perl -w

use strict;

my ($dbh, $sqlstatement, $sth, @row);

#Windows-based Perl/DBI/MS Access example

 use DBI;

#open connection to Access database

$dbh = DBI->connect('dbi:ODBC:pn', '', '');

##### pn is the name of the DSN.  The two blank ''

##### are where user and pw go.  But I did not use those.

 

#prepare and execute SQL statement

$sqlstatement="SELECT * FROM phone_number";

 $sth = $dbh->prepare($sqlstatement);

 $sth->execute ||

       die "Could not execute SQL statement ... maybe invalid?";

 

#output database results

 while (@row=$sth->fetchrow_array()) {

   ####

    print "@row\n";

   ####

 }

 # Finish results array fetch and database connection

 $sth->finish();

 $dbh->disconnect if $dbh;

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

Reply via email to