Nothing jumps out. All my SPs have > 1 param. Does this work?
mysqlpp::Query query2 = con->query();
query2 << "CALL sp_test(%0q)";
query2.parse();
query2.def[0U] = "1111111111111111";
TRACE_SQL(query2.preview());
query2.execute();
-----Original Message-----
From: Urscheler, Roger (COM Chantry CA)
[mailto:roger.urscheler@stripped]
Sent: Tuesday, March 06, 2007 1:37 PM
To: MySQL++ Mailing List
Subject: Mysqlpp 2.2.1 template problem
Can anybody tell me why I cannot call a SP with a single parameter with
index 0?
I have a stored procedure that takes a single IN parameter of type
VARCHAR(255).
It seems that when havng only a single parameter the index cannot be 0.
Btw: The same code worked with 2.1.7.
This works:
mysqlpp::Query query2 = con->query();
query2 << "CALL sp_test(%1:ap_serial)";
query2.parse();
query2.def["ap_serial"] = "'1111111111111111'";
TRACE_SQL(query2.preview());
query2.execute();
This too (if changing the SP to accept a second IN parameter:
mysqlpp::Query query2 = con->query();
query2 << "CALL sp_test(%0:ap_serial,%1:second_par)";
query2.parse();
query2.def["ap_serial"] = "'1111111111111111'";
query2.def["second_par"] = "55";
TRACE_SQL(query2.preview());
query2.execute();
But this causes error:
You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near 'CALL
sp_test('1111111111111111')'
mysqlpp::Query query2 = con->query();
query2 << "CALL sp_test(%0:ap_serial)";
query2.parse();
query2.def["ap_serial"] = "'1111111111111111'";
TRACE_SQL(query2.preview());
query2.execute();
__________________________________________________
roger.urscheler@stripped <mailto:roger.urscheler@stripped> ::
(905) 363-6400 x 6446 Chantry Networks, Siemens AG ::
www.chantrynetworks.com <http://www.chantrynetworks.com>