[PyQt] QSqlTableModel: how to check the UPDATE statement inside the model?

Sibylle Koczian Sibylle.Koczian at t-online.de
Tue Mar 11 11:53:50 GMT 2008


somewhere in the QSqlTableModel code there must be SQL statements for UPDATE, 
INSERT and DELETE, to make the model editable. Right? I can't find methods to 
view these statements - is it necessary to dig into the C++ code to find 

Background: I'm still trying to edit data in a view (SQL view, not Qt view) 
joining two tables. I wrote a trigger to make this possible at all, and in 
the command line client the update statements I construct myself are executed 
correctly. Same thing in PyQt, if I use QSqlQuery instances directly.

The database is Firebird 2.0.3, Qt version 4.3.4, PyQt 4.3.3, Python 2.5.1, OS 
Gentoo Linux.

If I use a QSqlTableModel, things get complicated: with the view in 
the "Employee" example database ("phone_list") all is still well, the 
database tables are updated using the view. With my own database I don't get 
any error messages, but no updates either. INSERT works as expected.

If I could execute the UPDATE statement used by the model in the command line 
client, I might find out what happens  - a bug in my trigger is quite 
probable. But for this I have to know this statement.

Can anybody help me?

Thank you,

Dr. Sibylle Koczian

More information about the PyQt mailing list