[Qt-interest] How to retreive a value in relational sql model?

jjDaNiMoTh jjdanimoth at gmail.com
Thu Dec 3 09:41:24 CET 2009


2009/12/3 Yevgen Yashchenko <lester.dev at gmail.com>:
> You see the rows in the table1 don't exactly match the appropriate rows in
> the table2. For example the first row in table1 can hold a key to the row 12
> in the table2, so just use of index.row() is insufficient. How this
> situation is beaten?

First of all, [1].
Then, you need to retrieve the key not from table1, but in table2, as
you know the name.

Ex.

Table1 --> id, name_id ( REF to Table2.id )
Table2 --> id, name

The mapper returns Table1.id, Table2.name where Table2.id == Table1.id

So, you need to find Table2.id where Table2.name is the value returned
from the mapper.

[1] http://www.faqs.org/rfcs/rfc1855.html

-- 
Key Fingerprint
4588 F931 A6E7 C7D5 A302  3064 12EB E87F 9B28 A9D2



More information about the Qt-interest-old mailing list