Create temporary table in Retool

Hi community,

I am trying to create a temporary table in Retool, this temporary table is used in a stored procedure in my database.
Then I create the temporary table and insert 2 rows in a query.

But when execute this query, the temporary table is not in my database, why?

And if i create other select query select count(*) from temp_delete_products; from this temporary table says me:

Sometimes works fine if i create the temporary table and insert and immediately execute a select count(*), for example

Captura de pantalla de 2022-05-13 17-28-44

My database is mysql.

How Retool manage the temporary tables?? How can i create a temporary table and work with it in my database?? Do the temporary tables have a lifetime in Retool??

Thanks!!!

What are you using? postgres, mysql, etc....?

Sorry, i forget it, i am using mysql

Does the resource connection ID/PW have the credentials to create temp tables? It may not....

Yes, have the credentials.

Sometimes works fine if i create the temporary table and insert and immediately execute a select count(*), for example

Captura de pantalla de 2022-05-13 17-28-44

hmmm. - tag this as a support question as it seems to work inconsistently....

Hey @ignacio!

Because of how routing is handled for SQL queries whenever you run a query, it's possible for that query to go through a new connection. This makes working with temporary tables across various queries unreliable and you may be better off using something like a front-end temp state to hold temporary data.

How exactly to handle this depends on what you're trying to do though. Would you be willing to share more about your particular use case for temporary tables?