Forum Academy Marketplace Showcase Pricing Features

SQL Connector Stored Procedure Can't Return Results

Hi there,
I have a stored procedure (MySQL) that takes in one value, and returns a list of items that match the input value. In testing outside of bubble.io, this works perfectly and returns a result set. When I try and move this to bubble, there is no prompt to select the outputs of the stored procedure into variables.

Does anyone have any ideas on how to generate a temporary table/list from the stored procedure output?

Below is the procedure, the test output, and how I added it to bubble.io.
From first glance, it seems bubble.io’s only stored procedure functionality is to initiate stored procedures, and cannot read returned data unless it is parameters.



Thanks for any input y’all might have!
Taylor

Edit: I could turn my stored procedure into a plain SELECT statement on bubble.io directly, but I’m afraid that would greatly affect performance once the result sets hit 100-200 rows.

I’ve had success using very complex select statements (multi-table joins, unions, grouping, order by, etc.) and the SQL connector performs very well. Give it a try - it shouldn’t take very long to move that sproc to a query on Bubble.

Thanks for the insight. I have copied the statement over to bubble directly and it seems to work well.

Maybe I’m just being overly cautious or lazy, but I was hoping to call the select functions strictly programmatically. The reason being that each of these statements (some very complicated) will likely need to be used on various parts of our infrastructure (not just my Bubble app) and I would hate to have to update and copy over each statement manually if I ever must make a change…

I’ll stick with your suggestion for now until they improve the functionality. Thank you!

Gotcha. FWIW, here’s a thread that discusses a workaround solution to get stored procedures to return results to Bubble by tricking it into thinking it’s a select statement:

I was wary of going down this path so I just went the straight select statement route. In your case where you are duplicating code, it might be worth considering though, so thought I’d point it out.

Joey