Call store procedure from Metabase

Hello friends!
I need call storeprocedure with a parameter type string. The parameter is a filter selection:



image
I need for each execute:
1- call storeprocedure with paramater (filter metabase): for mysql to update a temp table.
2- execute the normal select kpi.

Thank you

Hi @marozzir
I don't fully understand what you're trying to do, but you would probably have to do some sub-query that returns the filter variable selected to the SP. Something like this:
call mysp( (select my_column from my_table where {{fieldfilter}} limit 1) )
It might not be possible for you to do that with Field Filters and would require that you uses simple Text filter instead (without a dropdown).

I must use field filter. Can I convert the field filter to text in code? And then pass it to the SP

@marozzir Yes, by doing a sub-query like I wrote, which only returns a single value.
You are basically looking for something like this:
https://github.com/metabase/metabase/issues/5245 - upvote by clicking :+1: on the first post

Flamber, is good, the problem is i cant execute the next query, once executed the SP, or any other query.
Example:
image
where Temp_Location is modified by Store procedure (first sentence) in the data base internaly.
The second sentence should show results based on table modified by the SP.

@marozzir Then create a new SP, which both does the update and returns the results from the temp table.

Good Morning! I wish send a parameter to SP, is convenient have two filters filter1=DateFrom and filterr2 = DateTo???
This is for encode in mysql with BETWEEN in WHERE sentence?


If i use range of date, i cant use the filter in my mysql.
Thank

@marozzir You cannot use Field Filters like that. You will have to create two simple Date filters.
Please read the documentation carefully. Field Filters are very different than the other filters.
Redirecting…

Field filter variables should be used inside of a WHERE clause in SQL, or a $match clause in MongoDB.