Jim Wallace wrote:
> I use SPs almost exclusively with MySQL++. The first result set is
> always the one from the select in the SP. Then pull off the extra
> result set, otherwise the next call will fail.
>
> To get OUT params I do this: query << "call mysp(@x); select @x;"
> where the SP has one OUT param.
I do not have an OUT parameter for my stored procedure but the MySQL
documentation implies that a status is returned in every case in a CALL.
Is the result set returned before the stored procedure status ?
>
> -----Original Message-----
> From: Warren Young [mailto:mysqlpp@stripped]
> Sent: Tuesday, January 27, 2009 8:57 PM
> To: MySQL++ Mailing List
> Subject: Re: Calling stored procedure and returning result in SSQLS
> structure
>
> Edward Diener wrote:
>> How can I get my StoreQueryResult to store the row result of my query
>> into a vector of my SSQLS structure ? How do I know which result is
> the
>> row result of my query as opposed to the status result which gives
> only
>> a return status from my stored procedure ?
>
> You'd have to modify Query::storein() to teach it about multi-results.
> It might be better to fork it, and write storein_multi() instead.
>
> I have never used stored procedures, because I've never run into a
> situation where the optimization or security they offer mattered enough
> to overcome the associated problems. So, I have essentially no
> expertise to draw on, nor interest in seeing the weakness fixed. I'm
> willing to discuss patches to do it, but mostly you'd be on your own to
> implement it.
>
>> BTW the example in section 3.12 of the user manual calls a stored
>> procedure when the MySQL version is 5.0 or higher but does not set the
>
>> mysqlpp::MultiResultsOption(true) option. Is this an error in the
>> example or is there something in the example which would cause it to
>> work anyway ?
>
> The latter. It does set MultiStatementsOption(), which is sufficient.
> See http://dev.mysql.com/doc/refman/5.0/en/mysql-set-server-option.html
>