带参数的雪花任务调用存储过程

时间:2021-07-22 14:24:50

标签: stored-procedures snowflake-cloud-data-platform

snowflake 任务是否可以调用带有参数(例如日期)的存储过程?

1 个答案:

答案 0 :(得分:0)

是的,Snowflake 任务可以调用带有参数的存储过程:

CREATE OR REPLACE PROCEDURE testproc( var1 varchar )
returns string not null
language javascript
execute as caller
as
$$
return 'var1=' + VAR1;
$$
;


CALL testproc( current_date );

create task test_task
WAREHOUSE = gokhan_wh
SCHEDULE = '1 minute'
as
CALL testproc( current_date );

alter task test_task resume;

select * from table(information_Schema.TASK_HISTORY( task_name => 'TEST_TASK'));