Re: [sqlalchemy] Facing problem with aliasing while using union_all

2011-04-29 Thread monster jacker
On Wed, Apr 27, 2011 at 8:42 PM, Michael Bayer mike...@zzzcomputing.comwrote: On Apr 27, 2011, at 10:58 AM, monster jacker wrote: The Query should return to you tuples that have names like row_num and test_msg, which are linked to the anon names that it generates: for row in

Re: [sqlalchemy] Facing problem with aliasing while using union_all

2011-04-29 Thread Michael Bayer
On Apr 29, 2011, at 2:38 AM, monster jacker wrote: When i tested with 0.7b4 version of SQLAlchemy the above issue is resolved.Earlier i was testing with 0.6.6 version of SQLAlchemy. After doing the union_all when i try to do the query.order_by(desc('crt_dt')) on query object i

Re: [sqlalchemy] Facing problem with aliasing while using union_all

2011-04-27 Thread monster jacker
The Query should return to you tuples that have names like row_num and test_msg, which are linked to the anon names that it generates: for row in myquery: print row.row_num, row.test_msg that is, the anon_x names do not matter. they are an artifact of how the Query does its work and the

Re: [sqlalchemy] Facing problem with aliasing while using union_all

2011-04-27 Thread Michael Bayer
On Apr 27, 2011, at 10:58 AM, monster jacker wrote: The Query should return to you tuples that have names like row_num and test_msg, which are linked to the anon names that it generates: for row in myquery: print row.row_num, row.test_msg that is, the anon_x names do

Re: [sqlalchemy] Facing problem with aliasing while using union_all

2011-04-27 Thread Michael Bayer
On Apr 27, 2011, at 10:58 AM, monster jacker wrote: The Query should return to you tuples that have names like row_num and test_msg, which are linked to the anon names that it generates: for row in myquery: print row.row_num, row.test_msg that is, the anon_x names do

Re: [sqlalchemy] Facing problem with aliasing while using union_all

2011-04-18 Thread Michael Bayer
On Apr 18, 2011, at 1:50 AM, monster jacker wrote: Hi Micheal, As per your comment you want to say this issue whatever i am facing is resolved in 0.7 version of sqlalchemy? If i use the 0.7beta version this issue can be resolved? that is the case What i

Re: [sqlalchemy] Facing problem with aliasing while using union_all

2011-04-17 Thread monster jacker
On Sat, Apr 16, 2011 at 8:00 PM, Michael Bayer mike...@zzzcomputing.comwrote: On Apr 16, 2011, at 3:57 AM, monster jacker wrote: query.union_all(query1, query2) is producing below select statement.As i added label method to change labels of columns to refer in the code. anonimous column

[sqlalchemy] Facing problem with aliasing while using union_all

2011-04-16 Thread monster jacker
Hi all, I am facing the problem with aliasing when i try to do union of SA queries. Following three SA queries -- query = self.session.query(Table1.row_num.label('row_num'), Table.test_msg.label('test_msg'),

Re: [sqlalchemy] Facing problem with aliasing while using union_all

2011-04-16 Thread Michael Bayer
On Apr 16, 2011, at 3:57 AM, monster jacker wrote: query.union_all(query1, query2) is producing below select statement.As i added label method to change labels of columns to refer in the code. anonimous column names are giving reference errors while accesing result set. SELECT