Forum Academy Marketplace Showcase Pricing Features

How to return values within a repeating group using STORED PROCEDURES and PREPARED STATEMENTS?

I need to run a Sotred Procedure in Bubble that use prepared statements but it´s not working.

My database has different tables for each state in Brazil. The app user will chose the state and other filters so he/she can have the result that they are looking for. So, my query need to use a variable to run the exact state.

However it seems that Bubble doesn’t read the “SET @variable” command. This is the errro message: “SQL Database Connector issue: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘SET @s = CONCAT("SELECT es.cnpj, es.nome_fantasia, es.razao_social, es.inicio_at’ at line 2”

Does anybody have any idea about this issue?