Hi,
I need to use SQL templating with customSelectExpression with a MySQL function 'ifnull()' to do something special when the DB column 'app_name' is null
(This is a simplified version of the final select expression that I will use, but even this one was not working.)
Upon a 'fetch' operation, there were no MySQL syntax error messages, but the field values were all null (blank) in the databound visual component. Other fields in the same table could be correctly fetched.
So has anyone tried using MySQL's ifnull() function with SmartGWT?
My software and browser versions:
SmartClient Version: v8.3p_2013-03-22
Chrome Version 26.0.1410.43m
Log file content:
I need to use SQL templating with customSelectExpression with a MySQL function 'ifnull()' to do something special when the DB column 'app_name' is null
Code:
ifnull( da.app_name, 'need decoding' ) as appDecoded
Upon a 'fetch' operation, there were no MySQL syntax error messages, but the field values were all null (blank) in the databound visual component. Other fields in the same table could be correctly fetched.
So has anyone tried using MySQL's ifnull() function with SmartGWT?
My software and browser versions:
SmartClient Version: v8.3p_2013-03-22
Chrome Version 26.0.1410.43m
Log file content:
Code:
=== 2013-04-01 19:11:18,815 [0-28] INFO RequestContext - URL: '/leecyDynDs2/sc/IDACall', User-Agent: 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31': Safari with Accept-Encoding header === 2013-04-01 19:11:18,817 [0-28] DEBUG XML - Parsed XML from (in memory stream): 2ms === 2013-04-01 19:11:18,818 [0-28] DEBUG RPCManager - Processing 1 requests. === 2013-04-01 19:11:18,818 [0-28] DEBUG RPCManager - Request #1 (DSRequest) payload: { criteria:{ }, operationConfig:{ dataSource:"topAppsRealmsDaily", operationType:"fetch", textMatchStyle:"exact" }, startRow:76, endRow:151, componentId:"isc_ListGrid_1", appID:"builtinApplication", operation:"topAppsRealmsDaily_fetch", oldValues:{ } } === 2013-04-01 19:11:18,820 [0-28] DEBUG XML - Parsed XML from (in memory stream): 2ms === 2013-04-01 19:11:18,822 [0-28] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null === 2013-04-01 19:11:18,822 [0-28] DEBUG DeclarativeSecurity - DataSource topAppsRealmsDaily is not in the pre-checked list, processing... === 2013-04-01 19:11:18,823 [0-28] DEBUG AppBase - [builtinApplication.topAppsRealmsDaily_fetch] No userTypes defined, allowing anyone access to all operations for this application === 2013-04-01 19:11:18,823 [0-28] DEBUG AppBase - [builtinApplication.topAppsRealmsDaily_fetch] No public zero-argument method named '_topAppsRealmsDaily_fetch' found, performing generic datasource operation === 2013-04-01 19:11:18,823 [0-28] INFO SQLDataSource - [builtinApplication.topAppsRealmsDaily_fetch] Performing fetch operation with criteria: {} values: {} === 2013-04-01 19:11:18,824 [0-28] INFO SQLWhereClause - [builtinApplication.topAppsRealmsDaily_fetch] empty condition === 2013-04-01 19:11:18,824 [0-28] INFO SQLDataSource - [builtinApplication.topAppsRealmsDaily_fetch] derived query: SELECT t.id, t.date, t.application, da.app_name, t.realm_name, t.num_subscribers, t.upBytes , ifnull( da.app_name, 'need decoding' ) as appDecoded FROM leecy_top_apps as t left outer join app_table as da on t.application = da.app_id WHERE true or t.application >= (2<<24) === 2013-04-01 19:11:18,824 [0-28] DEBUG SQLDataSource - [builtinApplication.topAppsRealmsDaily_fetch] Executing row count query: SELECT COUNT(*) FROM leecy_top_apps as t left outer join app_table as da on t.application = da.app_id WHERE true or t.application >= (2<<24) === 2013-04-01 19:11:18,824 [0-28] DEBUG SQLDataSource - [builtinApplication.topAppsRealmsDaily_fetch] Eval'd row count query: SELECT COUNT(*) FROM leecy_top_apps as t left outer join app_table as da on t.application = da.app_id WHERE true or t.application >= (2<<24) === 2013-04-01 19:11:18,824 [0-28] DEBUG PoolableSQLConnectionFactory - [builtinApplication.topAppsRealmsDaily_fetch] Executing pingTest 'select 1 from dual' on connection 2144383467 === 2013-04-01 19:11:18,825 [0-28] DEBUG SQLConnectionManager - [builtinApplication.topAppsRealmsDaily_fetch] Returning borrowed connection '2144383467' === 2013-04-01 19:11:18,826 [0-28] DEBUG SQLTransaction - [builtinApplication.topAppsRealmsDaily_fetch] Started new central_aware_db_4100 transaction "2144383467" === 2013-04-01 19:11:18,826 [0-28] DEBUG SQLDriver - [builtinApplication.topAppsRealmsDaily_fetch] About to execute SQL query in 'central_aware_db_4100' using connection '2144383467' === 2013-04-01 19:11:18,826 [0-28] INFO SQLDriver - [builtinApplication.topAppsRealmsDaily_fetch] Executing SQL query on 'central_aware_db_4100': SELECT COUNT(*) FROM leecy_top_apps as t left outer join app_table as da on t.application = da.app_id WHERE true or t.application >= (2<<24) === 2013-04-01 19:11:19,187 [0-28] INFO SQLDataSource - [builtinApplication.topAppsRealmsDaily_fetch] Row count query found 223662 rows, which exceeds the DataSource's progressiveLoadingThreshold of 200000. Switching to progressive loading mode. === 2013-04-01 19:11:19,187 [0-28] DEBUG SQLDataSource - [builtinApplication.topAppsRealmsDaily_fetch] Using SQL Limit query === 2013-04-01 19:11:19,187 [0-28] DEBUG SQLDataSource - [builtinApplication.topAppsRealmsDaily_fetch] SQL windowed select rows 76->151, result size 76. Query: SELECT t.id, t.date, t.application, da.app_name, t.realm_name, t.num_subscribers, t.upBytes , ifnull( da.app_name, 'need decoding' ) as appDecoded FROM leecy_top_apps as t left outer join app_table as da on t.application = da.app_id WHERE true or t.application >= (2<<24) LIMIT 76, 76 === 2013-04-01 19:11:19,218 [0-28] INFO DSResponse - [builtinApplication.topAppsRealmsDaily_fetch] DSResponse: List with 76 items === 2013-04-01 19:11:19,218 [0-28] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8 === 2013-04-01 19:11:19,218 [0-28] DEBUG SQLTransaction - Committing central_aware_db_4100 transaction "2144383467" === 2013-04-01 19:11:19,221 [0-28] DEBUG SQLTransaction - Returning transactional connection for central_aware_db_4100 with hashcode "2144383467" === 2013-04-01 19:11:19,221 [0-28] DEBUG SQLTransaction - Ending central_aware_db_4100 transaction "2144383467" === 2013-04-01 19:11:19,222 [0-28] DEBUG SQLConnectionManager - About to close PoolableConnection with hashcode "2144383467" === 2013-04-01 19:11:19,222 [0-28] DEBUG PoolableSQLConnectionFactory - Executing pingTest 'select 1 from dual' on connection 2144383467 === 2013-04-01 19:11:19,224 [0-28] INFO Compression - /leecyDynDs2/sc/IDACall: 12335 -> 1470 bytes
Comment