Dear group,
I'm having the following issue with "Ambiguous column name", in this
situation:
#code example begin
connString = 'sqlite:///data/prosafelocal.sqlite'
engine = create_engine(connString)
connection = engine.connect()
query = 'SELECT crfItem.idCrf, crfItem.idClass,
class.name,
attribute.id,
attribute.name from crfItem JOIN class ON
crfItem.idClass =
class.id JOIN attribute on
class.id =
attribute.idClass WHERE crfItem.idCrf = 1'
result = self.connection.execute(query, use_labels=True)
#code end
I'm using connection.execute(query) directly with literal sql syntax.
I get the following error:
"try 'use_labels' option on select statement." % colname)
InvalidRequestError: Ambiguous column name 'name' in result set! try
'use_labels' option on select statement."
The "name" column is present in two joint tables, and it generates the
ambiguity.
Anyway, it seems like the option "use_labels=True" does is not
affecting my query behaviour.
Any help would be really appreciated.
Thanks,
Mauro