[Qt-interest] Problem with QSqlQuery ?

Mhayk Whandson eu at mhayk.com.br
Tue Sep 15 23:34:45 CEST 2009


Hi all, I would like to know what is the difference between this 2
options below:

#define RESTART_SEQUENCE_DSM_TEMP_ITEMS_PRESELL_ID "alter sequence
dsm_temp_items_presell_id_seq restart with 1"

First:
QSqlQuery *restart = new QSqlQuery;
restart->prepare(RESTART_SEQUENCE_DSM_TEMP_ITEMS_PRESELL_ID);
restart->exec();
delete restart;

Second:
QSqlQuery *restart = new QSqlQuery(RESTART_SEQUENCE_DSM_TEMP_ITEMS_PRESELL_ID);
delete restart;

The query just work with the second option :\ why ? I need to pass to
the QSqlQuery constructor ? Is it true ?

-- 
Mhayk Whandson
Linux User #413723
E-mail: eu at mhayk.com.br



More information about the Qt-interest-old mailing list