Re: ntext 8000 char limit - still there?

Randy Syring <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
Have you seen this:

http://www.freetds.org/userguide/troubleshooting.htm#KNOWNISSUES

There is some info there about lengths for both varchar and text.

*Randy Syring*
Husband | Father | Redeemed Sinner

/"For what does it profit a man to gain the whole world
and forfeit his soul?" (Mark 8:36 ESV)/

On 08/14/2014 11:45 AM, Nem W Schlecht wrote:
> Hello all,
>     I'm using FreeTDS with Perl and I'm trying to insert large chunks of
> text into a table with an NTEXT field.  My script runs and produces no
> errors, but I'm only getting 8000 chars when I call
> DATALENGTH(ntextfieldname) on the SQL side.  I found a discussion on this
> back from 2004 in the FreeTDS list where it said this was a limitation of
> the protocol.
>
> Is this still a limit?  What is the accepted way of getting around this
> limitation and inserting large-sized values into NTEXT fields?
>
>
> My test code:
> #!/usr/bin/perl
>
> #CREATE TABLE testinsert (
> #   querytext NTEXT
> #);
>
> use DBI;
>
> my @srvopts;
> push(@srvopts, "server=MyServer");
> push(@srvopts, "database=MyDatabase");
> my $srv_opts_joined=join(';', @srvopts);
>
> my $dbh = DBI->connect("dbi:Sybase:$srv_opts_joined", 'user', 'secret');
>
> my $sth = $dbh->prepare("
>      INSERT INTO testinsert
>          (querytext)
>      VALUES (?)
> ");
>
> my @words;
> open(WORDS, "/usr/share/dict/words");
> while (<WORDS>) {
>      push(@words, $_);
> }
>
> my $big = join('', @words);
> print "L: ", length($big), "\n";
> $sth->execute($big);
>
> $sth->finish();
> $dbh->disconnect();
>
> #
> # SELECT DATALENGTH(querytext) FROM testinsert;
> #
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.