Filter by language is not working (scripted view)
I wrote a scripted view for testing the concatenation of columns (String_AGG). The view should also retrieve the description for code values. I used the "$$language$$" construct but it is not working.
Hard coding the language returns any data. But using the language doesn't return any data:
Florian Pfeffer replied
what is $$language$$ in your opinion? A system variable? No such system variable exists to my knowledge.
You can determine the language of your session context using following statements:
select session_context('LOCALE') from dummy; -- e.g. en_EN
select session_context('LOCALE_SAP') from dummy; -- e.g. E
So you could select the language into a variable and use the variable in your statement:
declare lv_language nvarchar(1);
select session_context('LOCALE_SAP') into lv_language from dummy;