Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    DB2 - Column Heading Labels

    Hi,

    I get the >columnTitle< instead of >columnNames< from the SQLDataSource (DB2 V9 z/OS).

    Table TXYPR:
    Column = PRBICVO; Lable (Title) = BIC-VON

    Result:
    "BIC-VON ":"XXXXXXXXXX"

    expected:
    "PRBICVO ":"XXXXXXXXXX"

    Datasource.ds.xml:
    Code:
     <DataSource 
    	schema="OXQYPCQE" 
    	dbName="QXD0" 
    	tableName="TXYPR"
    	ID="TXYPR" 
    	dataSourceVersion="1"
    	noNullUpdates="true"
    
    	autoDeriveSchema="false"
    	autoDeriveTitles="false"
    	quoteColumnNames="true"
    	serverType="sql"> 
    	<fields>
    		
    		<field name="PRBICVO" length="11" type="text" /> 
    
    	</fields>
    	<operationBindings>
    		<operationBinding operationType="fetch">
    		  	<tableClause>OXQYPCQE.TXYPR TXYPR</tableClause> 
    	  	</operationBinding>
    	  	
    		<operationBinding operationType="remove">
    		  	<tableClause>OXQYPCQE.TXYPR TXYPR</tableClause> 
    	  	</operationBinding>
    	  	
    		<operationBinding noNullUpdates="true" operationType="update">
    		  	<tableClause>OXQYPCQE.TXYPR TXYPR</tableClause> 
    	  	</operationBinding>
    	</operationBindings>	
    </DataSource>
    SQL Statement (console):
    Code:
    === 2011-02-10 18:20:05,302 [l0-4] DEBUG SQLDataSource - [builtinApplication.TXYPR_fetch] JDBC driver windowed select rows 0->75, result size 75. Query: SELECT TXYPR."PRBICVO" FROM OXQYPCQE.TXYPR TXYPR WHERE ('1'='1')
    === 2011-02-10 18:20:05,308 [l0-4] INFO  DSResponse - [builtinApplication.TXYPR_fetch] DSResponse: List with 47 items
    DSRequest:
    Code:
    {
        "actionURL":"http://127.0.0.1:8888/ngp/sc/IDACall", 
        "showPrompt":true, 
        "prompt":"Finding Records that match your criteria...", 
        "transport":"xmlHttpRequest", 
        "promptStyle":"dialog", 
        "bypassCache":true, 
        "data":{
            "criteria":{
            }, 
            "operationConfig":{
                "dataSource":"TXYPR", 
                "repo":null, 
                "operationType":"fetch", 
                "textMatchStyle":"substring"
            }, 
            "startRow":0, 
            "endRow":75, 
            "componentId":"isc_ListGrid_2", 
            "appID":"builtinApplication", 
            "operation":"TXYPR_fetch", 
            "oldValues":{
            }
        }
    }
    DSResponse:
    Code:
    [
        {
            endRow:47, 
            queueStatus:0, 
            totalRows:47, 
            isDSResponse:true, 
            invalidateCache:false, 
            status:0, 
            startRow:0, 
            data:[
                {
                    "BIC-VON ":"XXXXXXXXXX"
                }, 
                {
                    "BIC-VON ":"XXXXXXXXXX"
                }, 
                {
                    "BIC-VON ":"XXXXXXXXXX"
                }, 
                {
                    "BIC-VON ":"XXXXXXXXXX"
                }, 
    .
    .
    .
               {
                    "BIC-VON ":"XXXXXXXXXX"
                }
            ]
        }
    ]
    I used:
    smartgwtpower-2.5 Build: 01.18.2011

    The eval version (smartgwtee-2.3) of 07.30.2010 it was still working!

    Please fix it.

    Regards,
    Timo

    #2
    We use the column label rather than its name to work around a quirk of the DB2 JDBC driver. If you have an aliased column name in a query, most databases/JDBC drivers return the alias name when ResultSetMetaData.getColumnName() is called. However, the DB2 JDBC driver (and recent versions of the MySQL driver) return the underlying source column name. In both cases (DB2 and MySQL), the solution is to call getColumnLabel() instead - indeed, MySQL release notes insist that this is the only behavior in keeping with the JDBC spec.

    You can disable the workaround by setting the following flag in your server.properties file:
    Code:
    sql.db2.useColumnLabelInMetadata: false
    However, be aware that if you do this you will probably start to see problems with any custom SQL that makes use of aliases, and with built-in features that do so (DataSourceField.customSelectExpression, for example)

    Comment


      #3
      perfect, thanks

      Comment

      Working...
      X