SpagoBILabs / SpagoBI

Outdated version of Knowage - Business Intelligence suite. Explore https://github.com/KnowageLabs for the current repository.
180 stars 110 forks source link

SPAGOBI-1934 - SPAGOBI 5.0 QBE, SQLServer and SQL Function calls #1411

Closed KnowageServiceAcc closed 4 years ago

KnowageServiceAcc commented 4 years ago

Details

Key Value
Key SPAGOBI-1934
Type Bug
Status Resolved
Priority Blocker
Resolution Fixed
Affects 5.0.0
Fix 5.1.0
Components SERVER/AdHoc/Qbe
Labels qbe

People

Key Value
Assignee Alberto Ghedin
Reporter john b

Dates

Key Value
Created 2014-10-31T17:17:52.000+0100
Updated 2014-12-12T12:34:41.000+0100
Resolved 2014-12-12T12:34:41.000+0100

Description

QBE seems to generate an error when creating a derived fields such as DATEDIFF(DAY,ScheduledDate,GETDATE())

We are using SQL Server 2008. DATEDIFF is a default function.

Comments

john b added a comment - 2014-10-31T19:29:02.843+0100

Another Example::

SELECT t_0.ExamID, t_0.ScheduledDate, CONVERT(VARCHAR,GETDATE(),110) FROM V_t_fact_visitexam t_0

This SQL works perfectly in SQL SQLServer....

SPAGOBI : An unpredicted error occurred while executing GET_SQL_QUERY_ACTION service. The root cause of the error is: No data type for node: org.hibernate.hql.ast.tree.MethodNode -[METHOD_CALL] MethodNode: '(' +-[METHOD_NAME] IdentNode: 'CONVERT' {originalText=CONVERT} -[EXPR_LIST] SqlNode: 'exprList' +-[IDENT] IdentNode: 'VARCHAR' {originalText=VARCHAR} +-[METHOD_CALL] MethodNode: '(' | +-[METHOD_NAME] IdentNode: 'GETDATE' {originalText=GETDATE} | -[EXPR_LIST] SqlNode: 'exprList' -[NUM_INT] LiteralNode: '110'

Alberto Ghedin added a comment - 2014-12-12T12:34:41.679+0100

it’s a very specific limitation of the library used to query SQLServer.. We’ve patched it for version 5.1 official (adding the functions dateadd, datediff, convert). The problem is that the library must know exactly what’s the returning type of the function. For this reason, with the patch, the convert function can return only Strings