thanksuse DBI; $DSN='.....'; $dbh = DBI->connect("dbi:ODBC:$DSN") or die "$DBI::errstr\n"; my $sth = $dbh->prepare('SELECT * FROM Test WHERE ServerName = ?') or die "Couldn't Prepare statement: " . $dbh->errstr; print "Enter ServerName> "; while ($ServerName = <>) { my @data; chomp $ServerName; $sth->execute($ServerName); # Read the matching records and print out while (@data = $sth->fetchrow_array()) { my $ServerType = $data[1]; my $WeekDays = $data[5]; print "\t$ServerType $ServerName $WeekDays\n"; } if ($sth->row == 0) { print "No servers matched \n\n"; } $sth->finish; print"\n"; print "Enter ServerName> "; } $dbh->disconnect;
In reply to Re^2: Can't locate object method "row" via package "DBI::st" error !
by dtharby
in thread Can't locate object method "row" via package "DBI::st" error !
by dtharby
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |