My Oracle Support Banner

OBIEE ODBC Error Returns When Filter Includes Cast Function and Session Variable (Doc ID 2162444.1)

Last updated on DECEMBER 06, 2016

Applies to:

Business Intelligence Server Enterprise Edition - Version to [Release 11g]
Information in this document applies to any platform.


On : version, Analytics

In RPD, create a session variable and create an initialization block.
Assign the default initialization value and Datasource from BIServer as


In Analysis, create a simple report with Year and Revenue columns;
Edit Revenue column formula and add FILTER expression as below:

FILTER("Base Facts"."Revenue" USING (YEAR("Time"."T00 Calendar Date")=CAST(VALUEOF(NQ_SESSION."session variable")as double)))

Check the results and you see the ODBC error message:

Error generating view. Error getting cursor in GenerateHead
Error Details
Odbc driver returned an error (SQLExecDirectW).
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A
general error has occurred. [nQSError: 43113] Message returned from OBIS.
[nQSError: 27002] Near <(>: Syntax error [nQSError: 26012] . (HY000)


Checked the query log and found out that subject area name is added for the sessions variable.

The formula is supposed to be: CAST(VALUEOF("NQ_SESSION"."session variable")as double)

Instead, it turns out: CAST("Sample Sales Lite".VALUEOF("NQ_SESSION"."session variable")as double)

Notice, there is "Sample Sales Lite" added in the formula, which is wrong.


Migrated from to, the ODBC error returns. 


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.