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

In reply to FreeTDS/DBI 'Out of memory' by scain

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.