Skip to Content.
Sympa Menu

freetds - Inconsistent results - FreeTDS ( .53) and DBD Sybase ( 94 )

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Pothen, Abi" <APothen AT nb.com>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: Inconsistent results - FreeTDS ( .53) and DBD Sybase ( 94 )
  • Date: Tue, 23 Apr 2002 16:28:43 -0400


Hi,
I am getting inconsistent results for the following sql statements. I
would really appreciate if someone could help me to resolve this problem.

I am using FreeTDS ( .53) and DBD Sybase ( 94 ) to connect to MS SQL 7
and 2000 from a Sun Solaris box.

Please see Case 1 and Case 2.
Case 2 is producing inconsistent results.

Thanks in advance.






CREATE TABLE test
(
row_id int NOT NULL,
amt decimal(18,4) NULL
)
go

Case : 1
delete from test
insert into test ( row_id, amt) values (9631, 398880.0000)
insert into test ( row_id, amt) values (9632, 955.0000)
insert into test ( row_id, amt) values (9633, 1590.0000)
insert into test ( row_id, amt) values (9634, 851.0000)

Output of "select * from test" for the above data in the test table
=============================================
9631 398880.0000
9632 955.0000
9633 1590.0000
9634 851.0000

Case : 2
delete from test
insert into test ( row_id, amt) values (9630, 498880.0000)
insert into test ( row_id, amt) values (9632, 955.0000)
insert into test ( row_id, amt) values (9633, 1590.0000)
insert into test ( row_id, amt) values (9634, 851.0000)

Output of "select * from test" for the above data in the test table (
Incorrect )
=====================================================
9630 498880.0000
9632 430451.7296
9633 431086.7296
9634 430347.7296





test.pl
=====
$ENV{'SYBASE'} = '/usr/local/freetds' ;
use DBI;

$dbh = DBI->connect('dbi:Sybase:server='SQLSERVER' , 'user', 'password')
or die 'connect';
$dbh->do("use mydata");

$sth = $dbh->prepare('select * from test') or die 'prepare';
$sth->execute or die 'execute';
while (@data = $sth->fetchrow_array) {
print join("\t",@data) , "\n";
}
$sth->finish;
$dbh->disconnect;




Archive powered by MHonArc 2.6.24.

Top of Page