Kyle
Kyle

Reputation: 63

Oracle userenv() alterative for snowflake

In oracle userenv('LANG') is used to get the language but not sure how to achieve the same in snowflake. tried select SYS_CONTEXT('USERENV', 'LANGUAGE') as well not working. please help me with this

Upvotes: 0

Views: 431

Answers (1)

Alexander Klimenko
Alexander Klimenko

Reputation: 1695

I am not sure if it is the same thing as in Oracle, but Snowflake has a session parameter "LANGUAGE" applied to the current user's session.

You can get it as:

show parameters like 'LANGUAGE' in session;

Output: enter image description here

if you need to extract just a value, you need to use the result_scan method to select the desired column:

select $2 as LANGUAGE from table(result_scan(last_query_id()));

Output:

enter image description here

Upvotes: 2

Related Questions