scain has asked for the wisdom of the Perl Monks concerning the following question:
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:
Thanks all,#!/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"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: FreeTDS/DBI
by LD2 (Curate) on Aug 16, 2001 at 23:11 UTC | |
by scain (Curate) on Aug 17, 2001 at 01:14 UTC | |
by rasta (Hermit) on Aug 23, 2002 at 16:14 UTC | |
|
Re: FreeTDS/DBI
by adamsj (Hermit) on Aug 16, 2001 at 22:46 UTC |