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

asked 23 Jul '12, 14:36

Renato's gravatar image

Renato
2266614
accept rate: 0%

edited 23 Jul '12, 15:19

Breck%20Carter's gravatar image

Breck Carter
25.7k428592852

Thanks for the edit for readability, Breck.

(24 Jul '12, 10:36) Andy Quick

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,

permanent link

answered 24 Jul '12, 10:35

Andy%20Quick's gravatar image

Andy Quick
2.2k2737
accept rate: 45%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×75
×60
×16

question asked: 23 Jul '12, 14:36

question was seen: 684 times

last updated: 24 Jul '12, 10:36