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..

1 answer

  • answered 2021-10-24 16:27 Lukasz Szozda

    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

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum