2015-09-24 82 views
1

我正在使用Datenwerke ReportServer。我試圖通過DJBC使用Caché來源。 Here is a blog post from them on adding additional databases。不幸的是,我並不完全理解它。我把JDBC文件放在正確的位置,併爲Caché創建了一個groovy腳本。問題與奇怪的Query Wrapper有關。我可以通過的ReportServer UI成功測試數據源,但是當我試圖執行一個簡單的查詢,我得到以下錯誤:Datenwerke ReportServer,添加自定義數據源時遇到問題(Caché)

Error

Query could not be prepared: Error preparing statement for executing the report query : SELECT * FROM (SELECT * FROM (SELECT TOP 10 * FROM HS_IHE_ATNA_Repository.Aggregation) wrappedQry) limitQry LIMIT 50 OFFSET 0 /* token: 6aab148a-927b-45d5-9dfd-724788e139ca / / currentuser: 3 */

cache.groovy

package databasehelper; 

import net.datenwerke.rs.scripting.service.scripting.scriptservices.GlobalsWrapper; 
import net.datenwerke.rs.base.service.dbhelper.DatabaseHelper 
import net.datenwerke.rs.base.service.dbhelper.hooks.DatabaseHelperProviderHook 
import net.datenwerke.rs.base.service.dbhelper.queries.Query 
import net.datenwerke.rs.base.service.dbhelper.querybuilder.ColumnNamingService 
import net.datenwerke.rs.base.service.dbhelper.querybuilder.QueryBuilder 

class Cache extends DatabaseHelper { 

    public static final String DB_NAME = "Cache"; 
    public static final String DB_DRIVER = "com.intersys.jdbc.CacheDriver"; 
    public static final String DB_DESCRIPTOR = "DBHelper_Cache"; 

    @Override 
    public String getDescriptor() { 
     return DB_DESCRIPTOR; 
    } 

    @Override 
    public String getDriver() { 
     return DB_DRIVER; 
    } 

    @Override 
    public String getName() { 
     return DB_NAME; 
    } 

    @Override 
    public String createDummyQuery() { 
    return 'SELECT * FROM HS_IHE_ATNA_Repository.Aggregation' 
    } 

} 


def HOOK_NAME = "DATASOURCE_HELPER_Cache" 

def callback = [ 
      provideDatabaseHelpers : { 
       return Collections.singletonList(new Cache()); 
      } 
     ] as DatabaseHelperProviderHook; 

GLOBALS.services.callbackRegistry.attachHook(HOOK_NAME, DatabaseHelperProviderHook.class, callback) 

似乎是一個鐵打在這裏張貼這一點,尤其是

回答

2

通知提出的疑問:

SELECT * FROM (SELECT * FROM 
(SELECT TOP 10 * FROM HS_IHE_ATNA_Repository.Aggregation) 
wrappedQry) limitQry LIMIT 50 OFFSET 0 

CachéSQL不支持LIMITOFFSET

%VIDTOP可以在高速緩存中的SQL,而不是使用LIMIT/OFFSEThttp://docs.intersystems.com/cache20152/csp/docbook/DocBook.UI.Page.cls?KEY=GSQL_views#GSQL_C13474

+0

可悲的是我提出的,但我很欣賞的職位,將在希望接受它可以幫助別人的未來:) –

+0

@ ScottBeeson是的。這是希望。我明白問題提出後兩個月,你可能不需要答案:-) – adaptun

相關問題