dhruv gami
dhruv gami

Reputation: 57

execute multiple create view statements in snowflake

Is there a way to create multiple views in one query in Snowflake?

I keep getting error when I try this -

create or replace view forecast_view as
select * from forecast
where variable = 'Name'
    
go

create or replace view demand_view as
select * from demand
where variable = 'Name'

Error:

SQL compilation error: syntax error line 5 at position 0 unexpected 'go'.

I also tried this -

create or replace view forecast_view as
select * from forecast
where variable = 'Name';

create or replace view demand_view as
select * from demand
where variable = 'Name';

but it only executes the first create view statement.

Upvotes: 1

Views: 1614

Answers (1)

Toni
Toni

Reputation: 1585

There is no "go" command in SnowFlake:

SnowFlake Commands

Executing Multiple SQL Statements in a Stored Procedure

Upvotes: 1

Related Questions