January 28, 2012

darthczyz darthczyz
Lab Rat
1 posts

QMYSQL equivalent of MYSQL source function

 

Just wondering if anyone has had any success using the mysql source or \. function with in Qt. I’m trying to do:

  1. q.prepare("source myfile.tx");

But that is giving me a QMYSQL: Unable to execute query error. Same when I use \. Is that not supported by QMYSQL? Any good workarounds?

1 reply

January 28, 2012

Volker Volker
Mad Scientist
4887 posts

There is no built-in method for this. You will have to read the file yourself into a QString and pass that to the prepare method of a QSqlQuery.

 
  ‹‹ Restrict QGraphicsLineItem movement      Application path did not work! ››

You must log in to post a reply. Not a member yet? Register here!