I am using SYBASE ASE 12_2, Perl5.8.5, DBI-1.48 and I just loaded
DBD::Sybase 1.04 on a UNIX/Solaris System.
 
I received the following error, while trying to fetch a row.
 
DBD::Sybase - can't change context to database fights
Can't locate object method "fecth" via package "DBI::st" at
/usr/local/apache/cgi-bin/fetch2.cgi line 35.

 

A copy of the perl program is:

 

#!/usr/local/bin/perl -w
use warnings;
use strict;
use DBI;
use CGI qw(:standard);
BEGIN {
          $ENV{SYBASE} = '/usr/local/sybase';
      }

my ($dbh, $sth, $sql);

print header;
print start_html ("Data View Program");
my $line = "*" x 40, "<br>";
print <<inputform;
<center>

  <h1><font color="#0000CC" size="4" face="Times New Roman, Times,
serif"><strong><em> Flights Database <br>Data

   View For tblflights Table</em></strong></font></h1>$line
inputform


$dbh = DBI -> connect
      ("dbi:Sybase:server=DB1;database=fights;timeout=240", "opns",
"flights")
      or die ("Cannot connect: DBI::errstr");

$sql = qq(SELECT * FROM flights.opns.tblflights);     
   
$sth =  $dbh->prepare($sql);

$sth->execute() || die "Could not execute query $DBI::errstr";
my $counter = 1;

do {
      while (my $record = $sth->fecth) { 
            print "$counter: ";
            for my $field (@$record){
                  print "$field";
            }
            $counter++;
            print "<br>";
      }
}while ($sth->{syb_more_results});
      
$sth->finish();

$dbh->disconnect || die "Failed to disconnect\n";

print "<center>Goodbye<br>";
print end_html;
 

Reply via email to