Project

General

Profile

MySQL - Calling a stored procedure that returns a results set

Added by Gavin Blakeman about 3 years ago

Hi,

I have a stored procedure in MySQL that returns a results set. when I issue the command "CALL ps_projects_modelRead('2', '35')" in phpmyadmin as an SQL call, I get the correct result. However when I try to use a session.query() I get an error.

using projects_t = std::tuple;
{
Dbo::Transaction transaction { application.session() };
Wt::Dbo::collection projectsCollection;
projectsCollection = application.session().query(CALL ps_projects_modelRead('2', '35'));
}

The error I receive is "Error parsing SQL query: "CALL ps_projects_modelRead('2', '35')"". The application then dumps on a segfault.
'

Note that I am using a stored procedure to write data using session.execute with no issues. It is just appearing that the query is not allowing the pass through.

The stored procedure on the query is returning an SQL results set, not using [OUT] parameters.

The stored procedure runs fine when executed from phpmyadmin, so I am thinking the error is coming from Wt.

Any help would be appreciated.

Thanks