The script I'm using is basically this ....
$dbname = "dbi:Sybase:server=$ENV{SYBASE_DB_SERVER};".
"database=$ENV{SYBASE_DB_NAME}";
.
.
my $dbh=DBI->connect($dbname,$username,$password,
{ RaiseError => 1, AutoCommit => 1})
or die "Couldn't connect to database: " . DBI->errstr;
my $selsql = "select count(*) from $table";
I have tried both of the following:
my $count = $dbh->do($selsql); # returns -1
my $count = $dbh->selectrow_array($selsql); #returns 0
.
.
I have a similar version of this running against a DB2 database and it
works fine.
Hardy Merrill
<hmerrill@redh To: [EMAIL PROTECTED]
at.com> cc: [EMAIL PROTECTED]
Subject: Re: Problems with Sybase query
09/05/2002 results?
11:16 PM
How 'bout a snippet of code - just the relavent DBI code would
be helpful(connect, prepare, execute, fetch's, etc.).
--
Hardy Merrill
Senior Software Engineer
Red Hat, Inc.
[EMAIL PROTECTED] [[EMAIL PROTECTED]] wrote:
> I am using the DBD::Sybase driver to connect to a Sybase database running
> under Solaris.
>
> It seems to make the connection with no problem and I get no error
messages
> back, but when I try to select count(*) for any table, I get a result of
0
> even though I know there is data in the tables. (isql from the command
> line works fine.) I can not delete the records either. I have set
> RaiseError set to 1, but still don't get any errors. I can use the
> "table->info()" method and get back the list of tables in the database.
> Queries to the system tables seem to work (sysobjects, syscolumns).
>
> Any suggestions?