MySQL 1312 error Solution

Source: Internet
Author: User

A stored procedure with a select operation. The error 1312 is returned during execution and the record set cannot be returned in a given scenario. Solution: add the client_multi_results or client_multi_statements option when connecting to MySQL.

This is not a bug but correct and incluented behavior:
If you write C Programs that execute stored procedures with the call SQL statement, you
Must set the client_multi_results flag when you call mysql_real_connect (), either
Explicitly, or implicitly by setting client_multi_statements. This is because each call
Returns a result to indicate the call status, in addition to any results sets that might
Be returned by statements executed within the procedure. to process the result of a call
Statement, use a loop that CILS mysql_next_result () to determine whether there are more
Results. For an example, see section 22.2.9, "c api handling of multiple statement
Execution ".

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.