using query.setforwardOnly(TRUE) is not working..
insert procedure
DELIMITER $$
DROP PROCEDURE IF EXISTS `MYDB`.`qtestproc`$$
CREATE PROCEDURE `qtestproc`(TABLENAME char(20),TABLEVALUES LONGTEXT)
BEGIN
SET @s =CONCAT("INSERT INTO ",TABLENAME," values(",TABLEVALUES,")");
PREPARE stmt FROM @s;
EXECUTE stmt;
END$$
DELIMITER ;
DELIMITER $$
DROP PROCEDURE IF EXISTS `MYDB`.`qtestproc`$$
CREATE PROCEDURE `qtestproc`(TABLENAME char(20),TABLEVALUES LONGTEXT)
BEGIN
SET @s =CONCAT("INSERT INTO ",TABLENAME," values(",TABLEVALUES,")");
PREPARE stmt FROM @s;
EXECUTE stmt;
END$$
DELIMITER ;
To copy to clipboard, switch view to plain text mode
qt code
q.setForwardOnly( true);
q.prepare("Call `MYDB`.`qtestproc`("mytable","values");
q.exec();
qDebug(q.lastError().text());
QSqlQuery q;
q.setForwardOnly( true);
q.prepare("Call `MYDB`.`qtestproc`("mytable","values");
q.exec();
qDebug(q.lastError().text());
To copy to clipboard, switch view to plain text mode
still got same error : MYDB.qtestproc cant return a result set in a given context QMYSQL3: unable to execute query
im using qt3.3.6 with QMYSQL3
Bookmarks