Temporary table

Hi,
I am running into problems with SQL optimization and speed and under normal circumstances, I would use temporary tables. But I cannot figure out how to use temporary tables in Metabase.

When I use

DROP TABLE IF EXISTS tmp_test;
CREATE TEMPORARY TABLE IF NOT EXISTS tmp_test
SELECT * from mytable

it returns an error.
Can you please help me to understand if temporary tables are available in Metabase?
Thanks

Hi @ivobrabec
Please post “Diagnostic Info” from Admin > Troubleshooting.
Metabase doesn’t support multiple statement queries, since it doesn’t know which statement is failing in case of errors.
And Metabase is a reporting tool, so write operations are generally not allowed. Try using a stored procedure on the database instead.
Also, you might want to read through this too: https://www.metabase.com/blog/sql-best-practices/index.html

thanks, good to know that temporary tables are not supported. I have to check about the procedures on the database.