cancel
Showing results for 
Search instead for 
Did you mean: 

case insensitive search for ANALYTIC_PRIVILEGES.USER_NAME

0 Kudos

select "COLUMN_OBJECT", "CATALOG_NAME", "CUBE_NAME", "DESCRIPTION", "VIEW_TYPE" FROM "_SYS_BI"."BIMC_CUBES" BIMC_CUBES INNER JOIN "SYS"."ACCESSIBLE_VIEWS" ANALYTIC_PRIVILEGES ON (BIMC_CUBES."CATALOG_NAME" || '/' || BIMC_CUBES."CUBE_NAME" = ANALYTIC_PRIVILEGES."VIEW_NAME") LEFT OUTER JOIN "SYS"."VIEWS" VIEWS_INFO ON (ANALYTIC_PRIVILEGES."VIEW_NAME" = VIEWS_INFO."VIEW_NAME") WHERE upper(ANALYTIC_PRIVILEGES.USER_NAME) = upper('system') AND ANALYTIC_PRIVILEGES.SCHEMA_NAME = '_SYS_BIC' ORDER BY "CATALOG_NAME" ASC, "CUBE_NAME" ASC

I am trying to run the above query in hana system and it fails with following error:

Could not execute 'select "COLUMN_OBJECT", "CATALOG_NAME", "CUBE_NAME", "DESCRIPTION", "VIEW_TYPE" FROM ...' in 247 ms 718 µs .

SAP DBTech JDBC: [8]: invalid argument: SELECT without WHERE clause USER_NAME = ... not supported

I want to perform a case insensitive search on ANALYTIC_PRIVILEGES.USER_NAME hence the clause : upper(ANALYTIC_PRIVILEGES.USER_NAME) = upper('system') is used but it doesnt work.Anyone has a solution?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

It's not a problem of case sensivity.

It's a feature of system view ACCESSIBLE_VIEWS.

Definition:

ACCESSIBLE_VIEWS

Accessible views for a given user

This means: You are only allowed to select from this view if you add a 'USER_NAME = ...' in the where condition.

A 'where upper(USER_NAME) = ...' doesn't qualify.

For your problem you should consider a quite different approach, if you need case insensivity at all.

As far as I know user names in HANA aren't case sensitive.

'system' and 'SYSTEM' simply are the same user.

regards