Pdo cannot obtain the result set when accessing the SQL Server stored procedure. how can this problem be solved?

Source: Internet
Author: User
When pdo accesses the SQL Server stored procedure, it cannot obtain the result set. if the stored procedure directly accesses and returns the table, for example, select & nbsp; * & nbsp; from & nbsp; table & nbsp ;, yes, the result set can be obtained, but if a temporary table is used, such as: select & nbsp; * & nbsp; into & nbsp; # t1 & nbsp; from & nbsp; table1select & nbsp; * & nbsp; f pdo cannot obtain the result set when accessing the SQL Server stored procedure
If the stored procedure directly accesses and returns the table,
For example, select * from table can obtain the result set,
However, if a temporary table is used,
For example:
Select * into # t1 from table1
Select * from # t1
No. why?
------ Solution ----------------------
To prevent SQL attacks, php restricts the execution of only one SQL command by one database operation method (function ).
I hope you will notice this.

If
Select * into # t1 from table1
Select * from # t1
Is the content in the stored procedure
The returned result set contains two query results.
You need to use PDOStatement: nextRowset to traverse

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.