[DB-SIG] Re: May we get an actual ANSWER to the F.A.Q...How c an I
construct a dictionary???
jfranz at neurokode.com
Thu Sep 25 12:12:34 EDT 2003
> How odd! I had assumed that this would be an error. On the
> other hand, I don't really see why anyone would like to do
> that, and I could accept that a tuple -> dict tool would
> fail silently on something like this. I haven't tried this
> with db_row etc...
I know from experience that ADO silently fails on this - the
last column with a particular name prevents access to the
other same-name columns, except by index. This sort
of thing can happen unexpectedly when you select * from
multiple tables with some common column names - but
that is bad practice anyway.
I think a silent failure is a Bad Idea(TM) - but which
method would be acceptable to the community:
- throw an exception
- allow access to the other same-name columns via a
suffix/renaming scheme ('A:1', 'A:2', ...)
At first blush, I like throwing an exception. The second
option is semi-useful, but the name mangling would need
to be Well documented and standardized. Unless a user
had read deep into the docs, mangling would be unexpected
and possibly painful.
NeuroKode Labs, LLC
More information about the DB-SIG