Anirban Sarkar wrote:
I'm not sure I understand your question, so this might be completely off topic. If you are asking what I think you are, then the answer is simply to replace the m.* and h.* with explicit field references, perhaps using aliases as well. Try something like:Hi all,
Please refer to the sqlite query below:
set connection_no { }
set stmt "select m.*, h.* from mri m,hp_con h where m.rdg_flg = '0' and h.hp_id = $hp_no and m.con_no = h.con_no order by m.con_no;"
db1 eval $stmt {} {
lappend connection_no $con_no .f.l insert end $con_no
}
I have used two aliases for the two tables, m and h respectively. My problem is how do I access the field con_no in the mri table. What should be the syntax? The portion of the code where this is required is highlighted in red.
Any early help will be highly appreciated.
Regards, Anirban Sarkar
set stmt "select m.con_no as con_no, m.field1 as field1, h.field2 as field2
from mri m,hp_con h where m.rdg_flg = '0' and
h.hp_id = $hp_no and m.con_no = h.con_no order by con_no;"
This will return 3 fields for each row: con_no (from the mri table, which is exactly the same as the hp_con table because of the join), field1 (from the mri table), and field2 (from the hp_con table).
HTH Dennis Cote
P.S. your red highlighting didn't survive the trip through the mailing list manager.