Skip to content

Commit

Permalink
On Snowflake, fixed 'This session does not have a current schema' err…
Browse files Browse the repository at this point in the history
…or when translating legacy `IF OBJECT_ID('tempdb..#table', 'U') IS NOT NULL DROP TABLE #table;`
  • Loading branch information
schuemie committed Sep 25, 2024
1 parent 31e4913 commit 28cb10c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ Changes:

1. When creating emulated temp tables (Oracle, Spark, BigQuery), will first attempt to drop (if exist). This is to clean up any orphan tables from a previous (unsuccesful) run.

Bugfixes:

1. On Snowflake, fixed 'This session does not have a current schema' error when translating legacy `IF OBJECT_ID('tempdb..#table', 'U') IS NOT NULL DROP TABLE #table;`


SqlRender 1.18.1
================
Expand Down
2 changes: 1 addition & 1 deletion inst/csv/replacementPatterns.csv
Original file line number Diff line number Diff line change
Expand Up @@ -1326,7 +1326,7 @@ snowflake,COUNT_BIG(@a),COUNT(@a)
snowflake,NEWID(),UUID_STRING()
snowflake,"IF OBJECT_ID('@table', 'U') IS NULL CREATE TABLE @table (@definition);",CREATE TABLE IF NOT EXISTS @table (@definition);
snowflake,"IF OBJECT_ID('@table', 'U') IS NOT NULL DROP TABLE @table;",DROP TABLE IF EXISTS @table;
snowflake,"IF OBJECT_ID('tempdb..#@table', 'U') IS NOT NULL DROP TABLE #@table;",DROP TABLE IF EXISTS @table;
snowflake,"IF OBJECT_ID('tempdb..#@table', 'U') IS NOT NULL DROP TABLE #@table;",DROP TABLE IF EXISTS #@table;
snowflake,.dbo.,.
snowflake,CREATE TABLE #@table (@definition),CREATE TEMP TABLE #@table (@definition)
snowflake,CREATE CLUSTERED INDEX @index_name ON @table (@variable);,-- snowflake does not support indexes
Expand Down

0 comments on commit 28cb10c

Please sign in to comment.