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
Release: 2016-07-06 13:52:56
Original
1144 people have browsed it

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>
Copy after login
Copy after login

Return:

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

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

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

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>
Copy after login
Copy after login

Return:

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

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

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

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template