Hi,
I am working on QT4.4 with using visual studio2005. Till now there is no problem with QT sql module but now I am facing a problem with QT while calling stored procedures.
I am using MYSQL5.0 I connected to it properly and I am able to query the data from database schema .
Now i created one stored procedure name "district( )" and I was trying to execute the stored procedure using QT code.
distquery.prepare("CALL District()");
distquery.exec( );
QSqlQuery distquery;
distquery.prepare("CALL District()");
distquery.exec( );
To copy to clipboard, switch view to plain text mode
if I execute the above code the result set is nothing I am getting. I tried in another way as
distquery.exec( "CALL District()");
QSqlQuery distquery;
distquery.exec( "CALL District()");
To copy to clipboard, switch view to plain text mode
Then it is working and I am able to get the result set.But I if I try as shown below
distquery.exec( );
QSqlQuery distquery("CALL District()");
distquery.exec( );
To copy to clipboard, switch view to plain text mode
It is showing a message like
An unhandled win32 exception occurred in mysqld-nt.exe[584]
and after this I am not able to connect with database even I recompile and run the applicatio.It is showing unnable to connect.I am very much confused what happenig if I try in this way , I tried in this way because I want to create a query with string and the database connection name also ie
QSqluery query
("CALL district()" ,
QSqlDatabase :: QSqlDataBase("name"));
QSqluery query("CALL district()" , QSqlDatabase :: QSqlDataBase("name"));
To copy to clipboard, switch view to plain text mode
I am very much confused with whethre it is a problem with QT or with my app.
Please suggest me to solve this problem.
Regards,
Sudheer.
Bookmarks