How to call Stored Procedures in Snowflake?

In Snowflake the syntax is:

call my_db.my_tbl.my_Proc();

But running this in a TDP query window just errors out after awhile ("Snowflake Database Error | Make sure a correct host and port are specified.") and running it as a TDP script (under "automate") does the same (Script engine execution failed, "Object reference not set to an instance of an object.").

Am I out of luck or is there a known way to do this?

Did you install, and are using, the SnowFlake-specific ODBC driver for your connection, as noted in the Installation Guide or Help File?

If so, then I'd recommend opening a Support Case.

You should be able to run the procedure within the TDP client, or as a task within an automation script, unless there are SnowFlake constraints that I don't know about.

BTW, do you HAVE to run the proc by calling it via the CALL command in a script?
You should be able to hit the Execute Procedure facility to run the proc straight from the Object Explorer. Just trying to think of other ways to get this done.

Actually I found that it does run in the query window, but throws an error and made me think that it wasn't running.

I'll play with that Execute Procedure facility and see if it's less scary. Trying to make a process to hand off to less technical folks and would like to avoid any "ignore that error" instruction.

Attempting find the Execute Procedure utility through object explorer, it's not an option.
Toad Execute Proc

OK, right, my bad. Confirming that there's no Exec button or right-click for SnowFlake procedures. I was thinking there is an "Execute Procedure" facility like I see when connecting to relational data sources.

So, yeah, looks like you'll need to use CALL within the Editor to execute your procs, etc.

1 Like