Re: Error While Trying to Fetch a row

2005-11-04 Thread louis gonzales

I think you mispelled "fecth" should be "fetch"???

On Fri, 4 Nov 2005, [EMAIL PROTECTED] wrote:


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, "";
print <

  Flights Database Data

  View For tblflights Table$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 "";
 }
}while ($sth->{syb_more_results});

$sth->finish();

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

print "Goodbye";
print end_html;





--
/** Louis Gonzales ***\
/** http://www.linuxlouis.net \
/ [EMAIL PROTECTED] **\
/** HP Certified Professional \


Re: Error While Trying to Fetch a row

2005-11-04 Thread Thomas L. Shinnick
At 13:03 11/4/2005, you wrote:
>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

Since you mention the word 'flights' several times but only once mention 
'fights', I'd guess you typed the wrong database name.

>Can't locate object method "fecth" via package "DBI::st" at
>/usr/local/apache/cgi-bin/fetch2.cgi line 35.

Since the name of the program is "fetch2.cgi", I bet you wanted to 'fetch' 
rather than 'fecth'ing.

So, two typos, two error messages.  Can you see what the 'problem' is here?

>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, "";
>print <
>
>   Flights Database Data
>
>   View For tblflights Table$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 "";
>  }
>}while ($sth->{syb_more_results});
>  
>$sth->finish();
>
>$dbh->disconnect || die "Failed to disconnect\n";
>
>print "Goodbye";
>print end_html;




Error While Trying to Fetch a row

2005-11-04 Thread ithier
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, "";
print <

   Flights Database Data

   View For tblflights Table$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 "";
  }
}while ($sth->{syb_more_results});
  
$sth->finish();

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

print "Goodbye";
print end_html;
 



Re: Problem loading DBD::Sybase

2005-11-04 Thread Michael Peppler
On Thu, 2005-11-03 at 21:10 +0100, Michael Peppler wrote:
> On Thu, 2005-11-03 at 11:53 -0500, [EMAIL PROTECTED] wrote:
> > I have problem loading the DBD-Sybase-1.07 on Unix/Solaris 8 OS, SUN
> > Fire V880 hardware.   
> > 
> > The perl Makefile.PL and the make command runs fine, but the make test
> > command fails.
> 
> The problem here is that DBD::Sybase currently depends on the libblk.a
> library (the bulk-copy calls). This library isn't always installed along
> with the server, in particular on mixed 64/32 bit environments.

I have just placed DBD::Sybase 1.07_01 in
http://www.peppler.org/downloads. This version should detect the absence
of the blk library, and build a version of DBD::Sybase that doesn't use
these calls.

Michael
-- 
Michael Peppler  -  [EMAIL PROTECTED]  -  http://www.peppler.org/
Sybase DBA/Developer - TeamSybase: http://www.teamsybase.com/
Sybase on Linux FAQ: http://www.peppler.org/FAQ/linux.html




Re: error while trying to install DBI

2005-11-04 Thread Dan Scott
Strange -- just tried the exact same commands here and they worked as
expected. Maybe there was a temporary FTP server glitch.

Are you able to see the ftp.esoftmatic.com site?

Dan

On 11/3/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hello.
>
> I just installed perl 5.8.7 from active state. (I need to write perl
> scripts that run against DB2 databases on Windows platform).
>
>
>
> I then tried to run: ppm install
> ftp://ftp.esoftmatic.com/outgoing/DBI/5.8.4/DBI.ppd   but I get the
> following back:
>
>
>
> C:\Perl\bin>ppm install
> ftp://ftp.esoftmatic.com/outgoing/DBI/5.8.4/DBI.ppd
>
> Error: No valid repositories:
>
> Error: 500 Server closed connection without sending any data back
>
> Error: 500 Server closed connection without sending any data back
>
>
>
> I was going to run that and then run:  ppm install
> ftp://ftp.esoftmatic.com/outgoing/DBI/5.8.4/DBD-DB2.ppd
> 
>
> but don't understand what the error means? Can someone please help?
>
> Thanks,
>
> Bob
>
>
>
>
>
>
>