Forum Documentation Showcase Pricing Learn more

Mysql connector Requirement

Hi All,

I would like to know if the below-mentioned query can be used in bubble SQL connector, It essentially requires the bubble to filling values at two levels using parameters, I have always performed a query where the parameters would be similar for both the table in Join.

Can bubble handle parameters for both the tables in join separately?

select
parse_client_id,
sum(spend) as spend_ac,
sum(clicks) as clicks,
campaign_modifier as campaign_modifier
from
(SELECT
*
FROM
stats_data.xxy
where
parse_client_id = ?
AND date >= ?
AND date <= ?
AND dsp LIKE ? UNION ALL SELECT
*
FROM
stats_data.xxz
where
parse_client_id = ?
AND date >= ?
AND date <= ?
AND dsp LIKE ?) AS a
group by parse_client_id , campaign_modifier
limit 200;

Bubble just sends the query to your db and looks at the response, so yes it should work. And not that this should be taken as critique, but why just not try it out instead of asking on the forum? You would find out immediately :slight_smile:

Hi @simon7

i tried it yesterday and it gave an error to check the syntax, Which is why i dropped in the form, Let me retry the same.

Thats what I hoped :slight_smile: Maybe try a simpler query first and work up from there. Sometimes it takes a bit of trial and error.
You could also try writing you the stored procedure in your db and just call that. That would make the query much simpler in bubble.

Ps. To be honest I dont know if the sql connector supports stored procedures, but I believe it would.

I have SQL queries like this working just fine in Bubble. Selects like this will work and you shouldn’t need to explore stored procedures. To get the syntax correct, get the SQL to work first in your SQL development environment and then cut/paste it exactly into the Bubble query, replacing the values with ? as Bubble parameters (for MySQL that is). You also might want to try using parentheses around each select statement.