cancel
Showing results for 
Search instead for 
Did you mean: 

UltraliteJ is not returning the column name with a specific query

Former Member
2,104

I'm using ultraliteJ for Android version 12.0.1 build 3726.

My client has used a specific query** that didn't return the column name from the resultSetMetadata when used this ultralite commands: getAliasName / getTableColumnName.

I managed to get the name using the getWrittenName, but my doubt is if the getTableColumnName should have worked. On the InteractiveSQL the column name is shown.

** Query used.
SELECT PublicationID, PublicationType from
    (
    SELECT 0, 'All Database' UNION 
    SELECT 1, 'All Publications' UNION
    SELECT 2, 'BIZ' UNION
    SELECT 3, 'COMMOM' UNION
    SELECT 4, 'FUSION' UNION
    SELECT 5, 'MESSAGE' UNION
    SELECT 6, 'MQUEST' UNION
    SELECT 7, 'MSALES'
    )
AS mn (PublicationID, PublicationType) 

tks

Former Member
0 Kudos

Thanks for the edit for readability, Breck.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Renato,

While this answer may not be totally satisfying, I can say that this is expected behaviour given what the UltraLite C runtime returns for this query. The method getTableColumnName calls

 ULResultSetSchema::GetColumnName(cid, ul-name-type-base-column )
(see http://dcx.sybase.com/index.html#1201/en/ulc/ulc-ulcpp-ulcpp-h-fil-ul-column-name-type-enu.html). This call returns null because there is no underlying base table for this query. The method getAliasName uses the same UltraLite C call if the column is aliased.

The method getWrittenName calls

 ULResultSetSchema::GetColumnName(cid, ul-name-type-sql )
This call works with SELECT statements, without an underlying base table.

Thanks,

Answers (0)