sonia mawandia
sonia mawandia

Reputation: 55

snowflake error "SQL compilation error: Empty SQL statement."

ALTER VIEW "test_RAWDATA" RENAME TO "TBD_test_RAWDATA";

I am getting following error: SQL compilation error: Empty SQL statement.

I have tried with new sheet as well but it is giving this error everywhere.

Upvotes: 1

Views: 1659

Answers (1)

Robert Long
Robert Long

Reputation: 6802

This can happen when you execute certain SQL statements in the GUI along with some comments in the same line of the code. For example:

USE ROLE SYSADMIN;
USE "DEMO_DB"."PUBLIC";
CREATE TABLE t1 (id integer);
CREATE VIEW test_view as SELECT * FROM t1;

## View TEST_VIEW successfully created.

Now we can ALTER the view:

ALTER VIEW test_view RENAME TO test_view2;

##  Statement executed successfully.

but, if we add a comment:

ALTER VIEW test_view2 RENAME TO test_view3 ;  /* A comment */

## SQL compilation error: Empty SQL statement.

Upvotes: 1

Related Questions