'alternative for alter session set week_start in snowflake

I need to set week start from sunday as default in snowflake

i used

alter session set WEEK_START = 7;

when querying in snowflake worksheet it works fine but when using the same query via api it has no effect.

is there any way to set WEEK_START from sunday without using alter session.

thanks in advance..



Solution 1:[1]

You could submit multipe statements per request: Specifying Multiple SQL Statements in the Request and separate them with semicolon.

alter session set WEEK_START = 7; SELECT DAYOFWEEK()

is there any way to set WEEK_START from sunday without using alter session.

Setting the parameter on USER level that is used for making the API call.

ALTER USER <user_name_here> SET WEEK_START = 7;

Related Parameter Hierarchy and Types

Solution 2:[2]

Try using EXECUTE AS CALLER in SP.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Lukasz Szozda
Solution 2 himanshu saini