Search code examples
stored-proceduressnowflake-cloud-data-platformjava-stored-procedures

Can I run an external file in a Snowflake stored procedure?


if I have an R script that generates a table and I wanted to insert that into an existing datatable in Snowflake every day, could I automate that using a stored procedure?

Is there some functionality that could run my R script for me within the procedure? Could a javascript procedure do so?


Solution

  • If you want to run R scripts from Snowflake, the best you can set up is an external function:

    Basically set up a web server (or so) that can run the R script, and then you can tell Snowflake to call that server on a schedule with a task: