Sean Smith
1 min readFeb 19, 2024

--

Please add to this article and explain how you do common things you see in stored procedures like branching and exception handling in the case where you are running against a SQL Warehouse, which only allows SQL cells in the Notebook, and the supported SQL doesn't have BEGIN EXCEPTION WHEN blocks.

You can't even use variables in a Notebook that tagets a SQL Warehouse (Pro nor serverless). If you try you get the following error:

```

DECLARE test INT;

```

[UNSUPPORTED_FEATURE.TEMP_VARIABLE_ON_DBSQL] The feature is not supported: Temporary variables are not yet supported for queries from SQL warehouses.

I'm trying to be as generous as I can here, and my hope is that this all shakes out before things to GA, but I just don't see how you can truly migrate stored procedures until something more is given, like Oracle/PostgreSQL do blocks, and an IIF() built-in function, which is for inline SQL, not for branching logic.

--

--