on 2012 May 17 4:08 PM
Hi,
I'm using ultraliteJ version: 12.0.1 ebf: 3605. I got a problem when I try to get the ordinal position of a duplicated column when the table on the query has an alias. Below I will give some examples to explain it more:
My query: "SELECT idState, idState as state2 FROM bzState s" -> If I try to use this sentence rs.getOrdinal("idState"); (after executing and fetching the row) I get the error -143 (column not found). And if I remove the table alias (in my case the 's' value) the getOrdinal works without a problem.
Is there a limitation on ultraliteJ on this case?
tks
Renato,
That would seem to be a problem with the UltraLite C runtime. I expect the same result would occur if you used ULResultSetSchema::GetCoulmnID in the UltraLite C++ API. (This is what UltraLiteJ on Android uses).
Another workaround I could suggest is changing your query to
SELECT idState as state1, idState as state2 FROM bzState sYou could then retrieve the position of the first column with
rs.getOrdinal("state1")
I will add the issue to a list to investigate, but it will be low priority since there are workarounds.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, I had the same problem, but in my case I needed a table alias to do a join. I fixed my problem changing the table alias for the name of table, for example:
SELECT bzState.idState, bzState.idState as state2 FROM bzState
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
10 | |
10 | |
10 | |
10 | |
9 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.