Hello, I am using this statement with the DB SQL Executor node but it generates this error
CREATE VIEW OPERACIONES AS
SELECT “sex”, AVG(“age”)
FROM “PRUEBAS”.“PUBLIC”.“CENSUS_TEST”
GROUP BY “sex”;
This error:
ERROR DB SQL Executor 4:220 Execute failed: Uncaught exception of type ‘STATEMENT_ERROR’ on line 20 at position 1 : Cannot perform CREATE VIEW. This session does not have a current database. Call ‘USE DATABASE’, or use a qualified name.
However, when using the statements separately it works perfectly, these are the statements that I used separately
BEGIN
USE DATABASE “PRUEBAS”;
CREATE VIEW “OPERACIONES”
AS SELECT “sex”
FROM “PRUEBAS”.“PUBLIC”.“CENSUS_TEST”;
END
SELECT “sex”, AVG(“age”) FROM “PRUEBAS”.“PUBLIC”.“CENSUS_TEST” GROUP BY “sex”
Hi @slunah, this may not be the same issue, but I can get KNIME to produce the same error if I have specified an incorrect name for the default database in the snowflake connector:
Do you have any other DB SQL Executor calls? It might help us to help you a little if we had a wider view of your workflow including the connector, and could see exactly the text you have in the DB SQL Executor. What happens if you include a USE DATABASE and/or USE SCHEMA command in a DB SQL Executor prior to the one containing the CREATE VIEW ?