[unixODBC-support] PHP PDO unixODBC FreeTDS SQL Server text column size

Nick Gorham nick at lurcher.org
Mon Sep 24 00:10:28 BST 2012


On 21/09/12 10:14, Jochen Daum wrote:
> Hi again,
>
> with odbc Trace enabled I see now that the size of the text column
> that doesn't work is restricted to 4096 bytes, at least this is how I
> interpret the log:
>
> Column Name = [attaContent]
>                          Data Type = 0x7fbf7136d618 -> -1
>                          Column Size = 0x7fff8c0d11d4 -> 4096
>                          Decimal Digits = NULLPTR
>                          Nullable = NULLPTR
> [ODBC][29384][1348216767.780752][SQLColAttribute.c][286]
>                  Entry:
>                          Statement = 0x7fbf712a2580
>                          Column Number = 6
>                          Field Identifier = SQL_DESC_DISPLAY_SIZE
>                          Character Attr = (nil)
>                          Buffer Length = 0
>                          String Length = (nil)
>                          Numeric Attribute = 0x7fff8c0d11d8
> [ODBC][29384][1348216767.780768][SQLColAttribute.c][657]
>                  Exit:[SQL_SUCCESS]
>
Well, the driver is reporting that the column is 4096 bytes long, and is 
a SQL_LONGVARCHAR.
>
> Is there a setting to control the maximum number of bytes returned. I
> think I have these right in php.ini:
>
> odbc.defaultlrl = 10000000
>
> (also have
> mssql.textlimit = 2147483647
>
> ; Valid range 0 - 2147483647.  Default = 4096.
> mssql.textsize = 2147483647
>
> but this shouldn't matter, correct?)
No, the driver is reporting the column size, setting PHP variables wont 
change the driver.

-- 
Nick


More information about the unixODBC-support mailing list