|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-05-11 23:40 UTC] sysadminnospam at cheezy dot net
Problem: Queries and stored procedures returning varchar data do not return more than 256 chars. The rest is truncated. Affected functions: MSSQL_FETCH_OBJECT MSSQL_FETCH_ARRAY MSSQL_FETCH_ROW (didn't get opportunity to test, but seems likely) I know there was an earlier report similar to this in regards to NCHAR, however, varchar has nothing to do with unicode. Are we looking at the same problem here anyways? Any idea on how long 'til a solution, or some sort of work-around? Using datatype TEXT is NOT an option -- it puts too much overhead on transactions. Since this was classified as a Microsoft problem, I guess upgrading to 4.0.5 would not help, huh? Thanks. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 08:00:01 2025 UTC |
Here is a workaround that I have used with success. When returning a VARCHAR field F that can exceed 256 characters, I return several computed fields F1, F2, etc using the following SQL query syntax: SELECT ("<" + SUBSTRING(F, 1, 253) + ">") AS F1 , ("<" + SUBSTRING(F, 254, 253) + ">") AS F2 , ("<" + SUBSTRING(F, 507, 253) + ">") AS F3 FROM ... In my PHP code i put F1, F2, F3 together after removing the enclosing <> (which I put on in order to maintain white space at either end of each Fi): $F = substr($F1, 1, -1) . substr($F2, 1, -1) . substr($F3, 1, -1); Good luck! Magne