[SOLVED] Getting the OUT of a MySQL stored procedure?
Hi, I'm trying to get the value of a OUT variable from a stored procedure with no luck.
I'm using the code from the docs: http://doc.qt.nokia.com/4.7/qsqlquery.html#approaches-to-binding-values
I'm new to SPs so this is my test one:
abc(IN x INT, OUT y INT)
SET y = 11;
The code is:
QSqlQuery query (myDB);
query.prepare("CALL abc(?, ?)");
query.bindValue(1, 0, QSql::Out);
int i = query.boundValue(1).toInt(); // i is 65
I get this error: OUT or INOUT argument 2 for routine blah.abc is not a variable or NEW pseudo-variable in BEFORE trigger QMYSQL3
Thanks for any advice!
You should use the code from:
Thanks, Alexis. That's exactly what I was looking for.
Be sure and change the thread title to add a [Solved]. Thanks!
No problem! I looked for the "solved" button like at the Java forums. I didn't realize I had to edit the title manually.