Discussion:
[freetds] How to increase DBTEXTSIZE and DBTEXTSIZE.
Velichko Yuriy
2014-01-15 09:26:03 UTC
Permalink
Hello!

I need to fetch data from TEXT field.
But the data size of particular record is always 4096 (for data that
greater than 4kb)

int dataLength = dbdatlen( conn, i + 1 );

I found (for db-lib) that need to increase options DBTEXTSIZE and
DBTEXTSIZE to solve this problem:

dbsetopt( conn, DBTEXTSIZE, "2,147,483,647", -1 );

dbsetopt( conn, DBTEXTLIMIT, "2,147,483,647", -1 );

But these function return FAIL, and have no affect. The returned length
still 4096.

Is any other way in to fetch big data (text, varchar, varbinary...)?
--
Best Regards!
James K. Lowden
2014-01-16 00:47:18 UTC
Permalink
On Wed, 15 Jan 2014 11:26:03 +0200
Post by Velichko Yuriy
dbsetopt( conn, DBTEXTLIMIT, "2,147,483,647", -1 );
But these function return FAIL, and have no affect. The returned
length still 4096.
If you look for that symbol in dblib.c, you'll see it's not
implemented. The function writes a message to the log and returns
fail. It doesn't call the error handler because there's no official
message for "not implemented".

The string "2,147,483,647" would not work in any case; commas would
interfere with converting it to an integer.

You can achieve the same effect by sending

SET TEXTSIZE 2147483647

or I bet

SET TEXTSIZE power(2,31)

would work, too.

It also wouldn't be hard nowadays to fix dbsetopt(), should you be so
inclined. :-)

--jkl
Velichko Yuriy
2014-01-16 21:04:44 UTC
Permalink
Thanks for reply!
SET TEXTSIZE - works as expected.

But, of course will be great, if you implement "API way"!
Post by James K. Lowden
On Wed, 15 Jan 2014 11:26:03 +0200
Post by Velichko Yuriy
dbsetopt( conn, DBTEXTLIMIT, "2,147,483,647", -1 );
But these function return FAIL, and have no affect. The returned
length still 4096.
If you look for that symbol in dblib.c, you'll see it's not
implemented. The function writes a message to the log and returns
fail. It doesn't call the error handler because there's no official
message for "not implemented".
The string "2,147,483,647" would not work in any case; commas would
interfere with converting it to an integer.
You can achieve the same effect by sending
SET TEXTSIZE 2147483647
or I bet
SET TEXTSIZE power(2,31)
would work, too.
It also wouldn't be hard nowadays to fix dbsetopt(), should you be so
inclined. :-)
--jkl
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
--
Best Regards!
Loading...