freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: James Ponder <james AT squish.net>
- To: TDS Development Group <freetds AT franklin.oit.unc.edu>
- Subject: Re: ints don't work, trailing null on strings
- Date: Wed, 18 Oct 2000 22:43:44 +0100
On Wed, Oct 18, 2000 at 05:32:09PM -0400, Brian Bruns wrote:
> Can you tell me if you see this problem using TDS version 4.2 as well as
> 7.0?
> (do this by doing an 'export TDSVER=42' before running perl)
I hope this helps... (PS. Maybe you could say in the docs somewhere about
this export business, I've been recompiling every time I wanted a different
protocol!)
$ export TDSVER=42
$ ./test.pl
OUTPUT: 'hello' (length 6)
$ export TDSVER=70
$ ./test.pl
OUTPUT: 'hello' (length 6)
#!/usr/bin/perl -w
use DBD::Sybase;
use strict;
my $dsn = 'DBI:Sybase:server=xxx.xxx.xxx.xxx;database=xxx';
my $user = 'xxx';
my $pass = 'xxx';
my $dbh;
defined($dbh = DBI->connect($dsn, $user, $pass))
or die "Failed to connect to MS SQL database\n";
sub Q {
my $sth = $dbh->prepare($_[0]);
die 'Error: '.$_[0].':'.$dbh->errstr."\n"
if (!$sth or !$sth->execute);
return $sth;
}
my ($sth, $out);
#Q("DROP TABLE wibble");
Q("CREATE TABLE wibble (moo CHAR(20))");
Q("INSERT INTO wibble (moo) VALUES ('hello')");
$sth = Q("SELECT moo FROM wibble");
$out = ($sth->fetchrow_array)[0];
print "OUTPUT: '$out' (length ".length($out).")\n";
Q("DROP TABLE wibble");
Best wishes, James
--
James Ponder; www.squish.net
-
Re: ints don't work, trailing null on strings
, (continued)
- Re: ints don't work, trailing null on strings, James Ponder, 10/18/2000
- Re: ints don't work, trailing null on strings, Geoff Winkless, 10/18/2000
- Re: ints don't work, trailing null on strings, James Ponder, 10/18/2000
- Re: ints don't work, trailing null on strings, James Ponder, 10/18/2000
- Re: ints don't work, trailing null on strings, Michael Peppler, 10/18/2000
- Re: ints don't work, trailing null on strings, James Ponder, 10/18/2000
- Re: ints don't work, trailing null on strings, Michael Peppler, 10/18/2000
- Re: ints don't work, trailing null on strings, Bob Kline, 10/18/2000
- Re: ints don't work, trailing null on strings, Brian Bruns, 10/18/2000
- Re: ints don't work, trailing null on strings, Brian Bruns, 10/18/2000
- Re: ints don't work, trailing null on strings, James Ponder, 10/18/2000
- Re: ints don't work, trailing null on strings, James Ponder, 10/18/2000
- Re: ints don't work, trailing null on strings, Bob Kline, 10/18/2000
- Re: ints don't work, trailing null on strings, Bob Kline, 10/18/2000
- Re: ints don't work, trailing null on strings, Brian Bruns, 10/18/2000
- Re: ints don't work, trailing null on strings, Brian Bruns, 10/18/2000
- Re: ints don't work, trailing null on strings, Michael Peppler, 10/18/2000
- Re: ints don't work, trailing null on strings, James Ponder, 10/19/2000
- Re: ints don't work, trailing null on strings, Bob Kline, 10/19/2000
Archive powered by MHonArc 2.6.24.