PDA

View Full Version : Outer join in QSqlRelationalTableModel



Banjo
1st April 2008, 06:05
Hello
I am using a QSqlRelationalTableModel for a database table which has a foreign key relationship with a lookup table.

My question is that when I use model.setRelation, the SQL query that is created to populate the model uses an inner join. So, if a record has a foreign key equal to null, it is not returned to the model.

How would I change this query to an outer join to allow for nullable foreign keys?

Thanks in advance

jpn
1st April 2008, 06:28
199697 - QSqlRelation optimisation

Banjo
1st April 2008, 23:19
Hello
Thanks for that. In the interim is there a way to achieve this before this feature or should I stick to your previous suggestion about adding null records to lookup tables.
Thanks again.