On Jul 22, 2:42 pm, Michael Bayer <mike...@zzzcomputing.com> wrote: > "select col1, col2, col3 from assp_reportpolicytransactions ...." > > otherwise the SP has to be made such that distinct column names are produced. > I'm not familiar with MS-SQL's syntax there.
You are correct again. :) I though the issue was that "state" is reserved word, but I found in my storedproc that I've used "state" twice, one for business State, and another for Address State both returning as column "state". Thanks, Lucas > > On Jul 22, 2010, at 3:33 PM, Lukasz Szybalski wrote: > > > Hello, > > > What if there is a column that is called "state" > > When I try to add use_labels inside the execute statement I get below > > error. Should I be using the "use_labels" somewhere else?: > > > a[0].State > > Traceback (most recent call last): > > File "<stdin>", line 1, in <module> > > File "/home/lucas/tmp/sql2008/env/lib/python2.5/site-packages/ > > SQLAlchemy-0.6.3-py2.5.egg/sqlalchemy/engine/base.py", line 1943, in > > __getattr__ > > return self[name] > > File "/home/lucas/tmp/sql2008/env/lib/python2.5/site-packages/ > > SQLAlchemy-0.6.3-py2.5.egg/sqlalchemy/engine/base.py", line 1934, in > > __getitem__ > > "try 'use_labels' option on select statement." % key) > > sqlalchemy.exc.InvalidRequestError: Ambiguous column name 'State' in > > result set! try 'use_labels' option on select statement. > > > # -------unexpected keyword error > > > a=session.execute("assp_ReportPolicyTransactions @start_date=:start, > > @end_date=:end",params={'start':"20100701",'end':"20100719"},use_labels=True).fetchall() > > > Traceback (most recent call last): > > File "<stdin>", line 1, in <module> > > File "/home/lucas/tmp/sql2008/env/lib/python2.5/site-packages/ > > SQLAlchemy-0.6.3-py2.5.egg/sqlalchemy/orm/session.py", line 732, in > > execute > > engine = self.get_bind(mapper, clause=clause, **kw) > > TypeError: get_bind() got an unexpected keyword argument 'use_labels' > > > Thank you, > > Lucas > > > -- > > You received this message because you are subscribed to the Google Groups > > "sqlalchemy" group. > > To post to this group, send email to sqlalch...@googlegroups.com. > > To unsubscribe from this group, send email to > > sqlalchemy+unsubscr...@googlegroups.com. > > For more options, visit this group > > athttp://groups.google.com/group/sqlalchemy?hl=en. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.