Home >Backend Development >PHP Tutorial >pdo_odbc returns a maximum of 4096 characters when executing the SqlServer 2000 stored procedure. How to solve it?

pdo_odbc returns a maximum of 4096 characters when executing the SqlServer 2000 stored procedure. How to solve it?

WBOY
WBOYOriginal
2016-07-06 13:52:561133browse

Environment: win10 SqlServer2000 php5.5 yii2.0.7
Problem: After executing the stored procedure readAll(), a single line and single field can return up to 4096 characters, while the stored procedure definition is 8000 characters, resulting in incomplete display.
Code:

<code>$sp_sql = "EXEC {$sp_name} ";
$sp_command = $this->db->createCommand($sp_sql);
$stmt = $sp_command->query();
$rowset = $stmt->readAll();
var_dump($rowset);</code>

Return:

<code>array(1) { [0]=> array(1) { ["json"]=> string(4096) "{"RowCount":"56","Data":    
</code>

Tried method (no results): It seems that the odbc here is not valid for the PDO method.

<code>php.ini里面配置
odbc.defaultlrl = 4096
</code>

Reference materials (no results):
http://www.cnblogs.com/longhs/p/3628315.html

Reply content:

Environment: win10 SqlServer2000 php5.5 yii2.0.7
Problem: After executing the stored procedure readAll(), a single line and single field can return up to 4096 characters, while the stored procedure definition is 8000 characters, resulting in incomplete display.
Code:

<code>$sp_sql = "EXEC {$sp_name} ";
$sp_command = $this->db->createCommand($sp_sql);
$stmt = $sp_command->query();
$rowset = $stmt->readAll();
var_dump($rowset);</code>

Return:

<code>array(1) { [0]=> array(1) { ["json"]=> string(4096) "{"RowCount":"56","Data":    
</code>

Tried method (no results): It seems that the odbc here is not valid for the PDO method.

<code>php.ini里面配置
odbc.defaultlrl = 4096
</code>

Reference materials (no results):
http://www.cnblogs.com/longhs/p/3628315.html

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn