I've got a fairly complicated query (multiple joins) on a normalized sqlite database. The query does a SELECT *
to enable some automated attribute selection logic (so I can't eliminate the "*")
The problem I am having is that my result set contains multiple columns with the same attribute name. For example, one attribute common to each table in the query is "_id". When I go to call "cursor.getColumnIndex("_id")"
the value returned is always the index of the last "_id"
attribute in the result set column list (i.e. not the one I want). I'd love to be able to use my SQL alias prefixes like cursor.getColumnIndex("A._id")
but that is not working.
QUESTIONs
cursor.getColumnIndex(AttributeName)
returns the index of the last "AttributeName". Can anyone confirm this?Unfortunately the documentation doesn't mention anything about what you need to do, so I am assuming it cannot be done.
However, you say
The query does a SELECT * to enable some automated attribute selection logic (so I can't eliminate the "*")
What is this 'automated attribute selection logic' you speak of? Why do you require this?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With