PDA

View Full Version : QDataBrowser and QSqlCursor



ederbs
17th October 2006, 19:39
Hello,

Is there anyway to use one QSqlCursor with more than one table?

For instance:

I am interested in displaying the query results obtained from ten tables.

Any suggestions would be welcome.

Ederson de Moura.

jacek
17th October 2006, 19:41
Use QSqlSelectCursor.

ederbs
17th October 2006, 20:48
Humm, to effect inserts using QDataBrowser and QSqlForm.

jacek
17th October 2006, 21:19
Humm, to effect inserts using QDataBrowser and QSqlForm.
Then maybe you could use a view? Does your database supports view updates?

ederbs
18th October 2006, 03:29
I cannot use view.

Form looks at mine, each QLineEdit is in different tables, the QComboBox is research.

http://200.193.29.195/qt/form.png

The Sql passed for the DBA.

http://200.193.29.195/qt/sql.html

some hope for this.

Ederson de Moura

cristiano
18th October 2006, 15:52
Hi,

I am with the same problem and not meeting the solution.

Cris.

jacek
18th October 2006, 21:13
You could create a separate QSqlForm for each table.

ederbs
22nd October 2006, 17:35
I could also make this for transactions?

Something as:

QSqlDatabase::database()->transaction();
QSqlQuery query;

query.exec("INSERT INTO bairros (id_cidade, nm_bairro)"
"VALUES (" + Usuario + ", 8105) " );

QSqlDatabase::database()->commit();

Ederson de Moura

jacek
22nd October 2006, 18:25
I could also make this for transactions?
You start transaction for the whole connection, so if every QSqlForm or QSqlCursor instance uses the same connection, it will operate within the same transaction.