yeah i did that. it does not work.
above code is incorrect. it has the me.exec(create_tables_sql)

here is the correct code..
create_tables_sql =
"DROP PROCEDURE IF EXISTS `test`.`GetStockTotal`;"
"CREATE DEFINER=`root`@`localhost` PROCEDURE `test`.`GetStockTotal`(IN curstockid INT(11), OUT stocktotal DECIMAL(15,2))"
"BEGIN"
"DECLARE stocktotal FLOAT DEFAULT 0;"
"SELECT opbalance INTO stocktotal from ledgers where curid = curstockid;"
"END;";
me.exec(create_tables_sql);
QString create_tables_sql;
create_tables_sql =
"DROP PROCEDURE IF EXISTS `test`.`GetStockTotal`;"
"CREATE DEFINER=`root`@`localhost` PROCEDURE `test`.`GetStockTotal`(IN curstockid INT(11), OUT stocktotal DECIMAL(15,2))"
"BEGIN"
"DECLARE stocktotal FLOAT DEFAULT 0;"
"SELECT opbalance INTO stocktotal from ledgers where curid = curstockid;"
"END;";
QSqlQuery me;
me.exec(create_tables_sql);
To copy to clipboard, switch view to plain text mode
It does drop the procedure but the create procedure does not work.
Bookmarks