Hello Friends,
I am using FreeTDS and DBI to talk from my linux box to a
MSSQL Server 7 on a Win2k box. It has mostly been working
(I can insert & select varchars of up to 8000 bytes and
insert text blobs of over 10k), however, when I try to retrieve
a text block of just over 10k, I get "Out of memory!" from
perl. Now I could understand if this was a very large block
of text, but it really isn't. Also, there is only one row
in the table and only one column which contains this block
of text. Does anyone have any suggestions
on why this might be happening? My linux box is no slouch: dual
850Mhz PIII with 2G ram and gobs of /tmp and /swp available. I
am using Perl 5.6.1.
Here is my test code:
#!/usr/local/bin/perl -w
use DBI;
use strict;
$ENV{'SYBASE'} = '/usr/local/freetds';
$ENV{'TDSVER'} = 70;
my $server = "gene";
my $db = "ragedb";
my $user = "sqluser";
my $passwd = "sqluser";
my $dbh = DBI->connect("dbi:Sybase:server=$server;database=$db",$user,
+$passwd)
or die "--$!--\n";
$dbh->{LongReadLen}=25000; #bytes, fails even if I set this to 1000.
$dbh->{LongTruncOk}=1;
my $sth = $dbh->prepare("
select * from sctemp
");
$sth->execute;
while(my $data = $sth->fetch)
{
print "@$data\n";
}
Thanks all,
Scott