Long strings handling for MS SQL
Maciej Jaros <[email protected]>
| Newsgroups | gmane.comp.db.unixodbc.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi. I'm using using PHP 5.2 with unixODBC driver to connect to MS SQL. The problem is that string length gets truncated to 255 characters and setting odbc.defaultlrl to 4096 doesn't work. This doesn't seem to be a PHP problem as this works fine in PHP+Windows. The problem is probably that MS SQL can have more then 255 characters for varchar type. A workaround for this is to map long varchar fields to text. And so this won't work: SELECT myLongStr FROM myTable But this works fine: SELECT CAST(myLongStr as TEXT) as myLongStr FROM myTable Where myLongStr definition is e.g.: myLongStr varchar (7000) Regards, Nux. _______________________________________________ unixODBC-dev mailing list [email protected] http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev