Skip to Content.
Sympa Menu

freetds - [freetds] parameter cannot return more than 256 chars

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Federico Alves" <sales AT minixel.com>
  • To: <freetds AT lists.ibiblio.org>
  • Subject: [freetds] parameter cannot return more than 256 chars
  • Date: Sun, 30 Nov 2008 13:44:16 -0500

This is the issue that has been killing me. If I set tds_version=8.0 in
freetds.conf, then my perl does not pass any parameter at all. If I remove
the tds_version from the server definition in freetds, then the parameters
pass back and forth, but only 256 chars. You are right that the information
works fine with tds_version=8.0, but then how do I make my perl script work
again? This has been happening for ever. The only way to make my perl script
work, which uses DBI and DBD-Sybase 8.0, is to remove the tds_version from
freetds.conf and thus I guess it goes back to 4.2. But It makes little sense
anyway because I compiled freetds with version 8.0

tsql -C
Compile-time settings (established with the "configure" script)
Version: freetds v0.82
freetds.conf directory: /usr/etc
MS db-lib source compatibility: yes
Sybase binary compatibility: no
Thread safety: yes
iconv library: yes
TDS version: 8.0
iODBC: no
unixodbc: yes

Dear Frediano, can you please use your privileged mind and figure out why
this perl script works only in 4.2 emulation and not in 8.0? If you log into
my server the script is located on /var/lib/asterisk/agi-bin

#!/usr/bin/perl

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

my $dbh = DBI->connect("dbi:Sybase:minixel:1433", 'user', 'pwd', {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 testsql \@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;





  • [freetds] parameter cannot return more than 256 chars, Federico Alves, 11/30/2008

Archive powered by MHonArc 2.6.24.

Top of Page