Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Incorrect SQL Syntax for Snowflake Task

I’m trying to run the following snowflake task but I’m getting this error:

SQL compilation error: syntax error line 2 at position 2 unexpected ‘COPY’.

Does anyone know what the issue could be?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

CREATE TEMPORARY TABLE SCM.FACT.TEMP_TABLE AS SELECT * FROM SCM.FACT.LB WHERE 1 <> 1
COPY INTO @SCM.FACT.STAGE_RAW/LB_EXTRACT.PARQUET FROM (
SELECT 
      *
      FROM 
          SCM.FACT.LB )
FILE_FORMAT = (TYPE = 'PARQUET')
HEADER = TRUE
SINGLE = TRUE
OVERWRITE=TRUE
MAX_FILE_SIZE=5363709120

>Solution :

That looks like two separate commands to me. Try putting a semicolon after each command.

CREATE TEMPORARY TABLE SCM.FACT.TEMP_TABLE AS SELECT * FROM SCM.FACT.LB WHERE 1 <> 1;
COPY INTO @SCM.FACT.STAGE_RAW/LB_EXTRACT.PARQUET FROM (
SELECT 
      *
      FROM 
          SCM.FACT.LB )
FILE_FORMAT = (TYPE = 'PARQUET')
HEADER = TRUE
SINGLE = TRUE
OVERWRITE=TRUE
MAX_FILE_SIZE=5363709120;
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading