nicoduboulot
25th January 2016, 14:52
Hi,
I'm writing a Qt program which executes an SQL query; this query is fully configurable by the user. I need to know, for each field, its name and table, or if it's an alias or a computed value.
> select T_RECORD.*, T_TYPE.* from T_RECORD left join T_TYPE on T_RECORD.NUM_TYPE=T_TYPE.NUM_TYPE;
Say T_RECORD and T_TYPE both have a NAME field, query.record().field(i).name() return the same name. I need to be able to tell which field is from which table.
Again, the query is fully configurable. I can't make any asumption on table structures beforehand. I also want to allow table.* to be used, because some of them will have a lot of fields (100+).
Thanks for your help.
I'm writing a Qt program which executes an SQL query; this query is fully configurable by the user. I need to know, for each field, its name and table, or if it's an alias or a computed value.
> select T_RECORD.*, T_TYPE.* from T_RECORD left join T_TYPE on T_RECORD.NUM_TYPE=T_TYPE.NUM_TYPE;
Say T_RECORD and T_TYPE both have a NAME field, query.record().field(i).name() return the same name. I need to be able to tell which field is from which table.
Again, the query is fully configurable. I can't make any asumption on table structures beforehand. I also want to allow table.* to be used, because some of them will have a lot of fields (100+).
Thanks for your help.