List:MySQL++« Previous MessageNext Message »
From:Roger (COM Chantry CA) Urscheler Date:March 6 2007 6:37pm
Subject:Mysqlpp 2.2.1 template problem
View as plain text  
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>  


Thread
Mysqlpp 2.2.1 template problemCOM Chantry CA)6 Mar
RE: Mysqlpp 2.2.1 template problemJim Wallace6 Mar
RE: Mysqlpp 2.2.1 template problemCOM Chantry CA)6 Mar
  • Re: Mysqlpp 2.2.1 template problemWarren Young6 Mar
RE: Mysqlpp 2.2.1 template problemCOM Chantry CA)7 Mar
  • Re: Mysqlpp 2.2.1 template problemWarren Young7 Mar
RE: Mysqlpp 2.2.1 template problemCOM Chantry CA)9 Mar
  • Re: Mysqlpp 2.2.1 template problemWarren Young16 Mar
Re: Mysqlpp 2.2.1 template problemWarren Young17 Mar