php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1525 It's not possible to receive from MSSQL TEXT field more than 4K data
Submitted: 1999-06-10 23:44 UTC Modified: 2000-03-15 02:05 UTC
From: vin at dor dot ru Assigned:
Status: Closed Package: MSSQL related
PHP Version: 3.0.8 OS: Windows NT 4.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: vin at dor dot ru
New email:
PHP Version: OS:

 

 [1999-06-10 23:44 UTC] vin at dor dot ru
SET TEXTSIZE XXXX does change result dataset length but only
in less than 4K range


e.g.

function Get_Text_Field ( $Conn, $Doc_ID ) {
	$sql = "SET TEXTSIZE 65000";

        if( ! $RS = mssql_query( $sql, $Conn ) ) {
                return ;
        }


	$sql = "SELECT TextField FROM Doc WHERE Doc_ID=$Doc_ID";

        if( ! $RS = mssql_query( $sql, $Conn ) ) {
                return ;
        }

        if ($Result = mssql_fetch_object($RS))
		return $Result;
        else {
                return ;

        }
}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-03-15 02:05 UTC] fmk at cvs dot php dot net
you can set the following php3.ini options:

mssql.textsize	= 8192
mssql.textlimit = 8192

textlimit can be anything from 0 to text limit and textsize can be anything from 0 to 2Gb.

From the MS SQL Server docs:

SET TEXTSIZE (T-SQL)
Specifies the size of text and ntext data returned with a SELECT statement. 

Syntax
SET TEXTSIZE {number | @number_var}

Arguments
number | @number_var 
Is the size (an integer) of text data, in bytes. The maximum setting for SET TEXTSIZE is 2 gigabytes (GB), specified in bytes. A setting of 0 resets the size to the default (4 KB). 
Remarks
Setting SET TEXTSIZE affects the @@TEXTSIZE function.

The DB-Library variable DBTEXTLIMIT also limits the size of text data returned with a SELECT statement. If DBTEXTLIMIT is set to a smaller size than TEXTSIZE, only the amount specified by DBTEXTLIMIT is returned. For more information, see Programming DB-Library for C.

The SQL Server ODBC driver and Microsoft OLE DB Provider for SQL Server automatically set TEXTSIZE to 2147483647 when connecting.

The setting of set TEXTSIZE is set at execute or run time and not at parse time.

Permissions
SET TEXTSIZE permissions default to all users.



 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 15:01:28 2024 UTC