Community
Participate
Working Groups
Created attachment 168513 [details] screen shot description: When use 'select as' sql statement, the alias is not displayed in output column. build id: 2.6.0 v20100514-0630 steps to reproduce: 1. New a data source from sample db. 2. New a data set using the query below: select CLASSICMODELS.CUSTOMERS.CUSTOMERNUMBER as num from CLASSICMODELS.CUSTOMERS 3. Switch to Output Columns page. Expected result: 'num' should be displayed as alias. Actual result: 'num' is displayed as display name.See attached screen shot.
BIRT is based on ODA which provides following APIs about result set columns metadata in org.eclipse.datatools.connectivity.oda.IResultSetMetaData: /** * Returns the name of the specific column. * @param index column number (1-based). * @return the column name. * @throws OdaException if data source error occurs. */ public String getColumnName( int index ) throws OdaException; /** * Returns the designated column's suggested title for use * in the column heading and/or display name. * @param index column number (1-based). * @return the column's suggested title. * @throws OdaException if data source error occurs. */ public String getColumnLabel( int index ) throws OdaException; BIRT takes the getColumnName(index) return value as the "Name" of data set column and the getColumnLabel(index) return value as the "Display Name" of data set column. In this case, both getColumnName and getColumnLabel return "NUM". that's why "Name" and "Display Name" of data set column are displaying "NUM". "Alias" of data set column is only a BIRT concept and has nothing to do with ODA. BIRT never knows a default alias for a column from the query text. User has to specify it manually if it's needed. In fact, from the JDBC perstive, both java.sql.ResultSetMetaData#getColumnName() and getColumnLabel() just return "NUM" too for "the select CLASSICMODELS.CUSTOMERS.CUSTOMERNUMBER as num from CLASSICMODELS.CUSTOMERS" SQL query.
close.
*** Bug 321675 has been marked as a duplicate of this bug. ***
I created bug report in DataToolsProject https://bugs.eclipse.org/bugs/show_bug.cgi?id=321814
*** Bug 321814 has been marked as a duplicate of this bug. ***