🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Unable to run 'USE DATABASE' or 'USE WAREHOUSE' statement for Snowflake

User: "shanila"
New Altair Community Member
Updated by Jocelyn
USE WAREHOUSE WAREHOUSENAME
SELECT *
FROM "RAPIDMINER"."PUBLIC"."AUTHORDATASET" Exception: com.rapidminer.core.io.data.DataSetException Message: SQL compilation error: syntax error line 2 at position 0 unexpected 'SELECT'.

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "BalazsBaranyRM"
    New Altair Community Member
    Hi!

    This is an incorrect SQL statement. It might work in a special frontend that automatically separates Snowflake specific commands like USE from the other commands, but in this context it's not syntactically correct.

    Most databases use the semicolon to separate commands:

    USE WAREHOUSE WAREHOUSENAME;
    
    SELECT *
    FROM ...
    ;

    Check the documentation of your database for the separator character.
    It is still possible that it won't work, because somewhere between RapidMiner, the JDBC driver and the database some component doesn't accept multiple commands in one statement.

    In that case your best option is to specify the warehouse inside the connection object instead of changing it dynamically in the SQL statement.

    Regards,
    Balázs