Wednesday, November 21, 2007

MySQL Stored Procedure : can't return a result set in the given context

This problem came when i'm deploying the program and databases to the production server while it's running smooth on my local computer. This is terrible and i have a suspicious if there's something wrong with the MyODBC Connector in the production server. I need to know what version of MyODBC Connector installed on my local computer and on my production server so i can compare it. But how do i know the version of this MyODBC Connector?

Below is my step to find out the version of MyODBC Connector :
  1. Go to Control Panel -> Administrative Tools and choose Data Sources (ODBC).
  1. Click the Add button and scroll to the end of the data source list and you will find out the version of your MyODBC Connector like shown in the image below.

The version of MyODBC Connector on my computer is while the version on production server is The MyODBC Connector version on production server come with the installation of Plesk 8.1.

This why i got the error PROCEDURE db_name.procedure_name can't return a result set in the given context when running MySQL stored procedures on the production server. And after i upgraded the MyODBC Connector to the latest version then the problem is solved.

In the general case, the server did not know if a procedure will return just one result set, or more. So, it has to assume the "worst" case, that several results sets might be returned.

Make sure we are using the latest ODBC version. And don't forget to restarting the server to takes an effect.

The support for the CLIENT_MULTI_RESULTS flag was added in 3.51.12.

No comments: