cancel
Showing results for 
Search instead for 
Did you mean: 

Error on a specific query to get the ordinal position of the column

Former Member
3,401

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

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 s
You 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.

Answers (1)

Answers (1)

Former Member
0 Kudos

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