Home  >  Article  >  Backend Development  >  pdo 访问SQLSERVER存储过程无法获取结果集

pdo 访问SQLSERVER存储过程无法获取结果集

WBOY
WBOYOriginal
2016-06-23 13:47:501030browse

如果存储过程直接访问并返回表,
如select * from table ,是可以得到结果集的,
但如果是用临时表,
如:
select * into #t1 from table1
select * from #t1
 则不行,请问大家为什么


回复讨论(解决方案)

我试验过了,只要有into语句存在,则结果都不会获得

php 为防止 SQL攻击,限制一个数据库操纵方法(函数)只允许执行一条 SQL 指令
希望你注意到这一点

如果
select * into #t1 from table1
select * from #t1
是存储过程中的内容
那么他将返回包含两个查询结果的结果集
你需要用 PDOStatement::nextRowset  遍历之

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