[freetds] parameters missing in RC 64 Bits

Federico Alves sales at minixel.com
Sat Apr 19 23:39:47 EDT 2008


I have a perl script that I use to test my application, and executes a
stored procedure against SQL 2005, with "OUTPUT" parameters. It works fine
in 32 bits but fails to return any parameters in 64 Bits. This is the
script:

use strict;
use DBI;
my $server = "";
my $db = "minixel";
my $username = "sa";
my $password = "";

my $dbh = DBI->connect("dbi:Sybase:minixel:1433", 'user', 'password',
{PrintError => 0});
die "Unable for connect to server $DBI::errstr"
    unless $dbh;
$dbh->do("use $db");
my $query = "declare \@sessionid varchar(64), \@IPAddress varchar(40) ,
\@ReceivedNumber varchar(30) , \@ANI varchar(20) , \@protocol int  ,
\@timeout int select \@sessionid = '1120019620.8', \@IPAddress = '',
\@ReceivedNumber = '17274907253', \@ANI = '16463835040', \@protocol = 1,
\@timeout = 0  exec SoftRouting \@sessionid , \@IPAddress OUTPUT,
\@ReceivedNumber OUTPUT, \@ANI OUTPUT , \@protocol OUTPUT, \@timeout
OUTPUT";
my $sth = $dbh->prepare($query);
          $sth->execute();

do {
      while(my $dat = $sth->fetch) {
print "TYPE $sth->{syb_result_type}\n";
print "Data @$dat[0] , @$dat[1] , @$dat[2] \n";
         if($sth->{syb_result_type} == 4042) { # it's a PARAM result
           print "Number:  $dat->[0]  \n";
            print "Varpar:  $dat->[1]  \n";
         }
      }
   } while($sth->{syb_more_results});


$sth=undef;
$dbh->disconnect;

In 32 bits, I get data type 4042, but not in 64 Bits. The culprit is between
DBI, DBD or Freetds. How may we know what happens? This functionality is
very important for many people. This is the configure statement that I use:
./configure --prefix=/usr --with-tdsver=8.0 --enable-msdblib
--with-unixodbc=/usr --enable-msdblib  







More information about the FreeTDS mailing list