mssql stored procedure execution support in SQL Lab? #18380
Replies: 15 comments 3 replies
-
Is there a way to express wrap a sproc inside a select statement? As is |
Beta Was this translation helpful? Give feedback.
-
Thanks for getting back to me will give this a try. Would this method be able to support the passing of arguments from a filter slice do you think? |
Beta Was this translation helpful? Give feedback.
-
Well assuming that a sproc could be queried like a view, and wrapped in a subquery, yes, but that may not be possible. |
Beta Was this translation helpful? Give feedback.
-
Notice: this issue has been closed because it has been inactive for 377 days. Feel free to comment and request for this issue to be reopened. |
Beta Was this translation helpful? Give feedback.
-
This issue is not resolved yet. @mistercrunch Please reopen this one. |
Beta Was this translation helpful? Give feedback.
-
@mistercrunch Please reopen this one. I'm also facing the same problem. |
Beta Was this translation helpful? Give feedback.
-
This sounds like a related feature to extended CTE support which I'm currently looking into. It would be most helpful if you could elaborate with an example to make sure the feature request is as unambiguous as possible. |
Beta Was this translation helpful? Give feedback.
-
Please reopen. Ideally: Proc is for instance, "GetReturn_Timeseries_ByFund", with parameter @fundid int (e.g. CREATE PROC dbo.GetReturn_Timeseries_ByFund (@fundid INT)) We would then like to be able to execute this proc and get back the data by query folding from the final dashboard. So we'd pass a Fund Id of 253 or 11792 via the URL, and have the proc execute " EXEC dbo.GetReturn_Timeseries_ByFund @fundid = 253" Hopefully this explains the use case |
Beta Was this translation helpful? Give feedback.
-
closed #13577 and keep track of this issue in this thread |
Beta Was this translation helpful? Give feedback.
-
Does this perhaps fit into some of the native filter enhancements? |
Beta Was this translation helpful? Give feedback.
-
Another use case (DB2 and MSSQL) we have for calling stored procedures uses the I realize there is probably a lot of work to make this a reality, but wanted to just add an additional use case. |
Beta Was this translation helpful? Give feedback.
-
Working with superset-1.3.0 I come up with solution for this.... By default superset is framing one type of query format for query charts, so if we use store procedure in sql editor, application is changing this storeprocedure query into defualt query format,then it throws error. so we need to pass directly sp query . For that we need to add code in superset > connectors > sqla > models.py **query_word = str(tbl).casefold()
return SqlaQuery( It's working fine for me............ PFA |
Beta Was this translation helpful? Give feedback.
-
Who had a need for store procedure once the above code, it's working successfully. |
Beta Was this translation helpful? Give feedback.
-
Here is a potential solution, though I haven't thoroughly tested it myself. I tried this with Superset 2.0.1 By enabling DML queries on your DB connection, you can run stored procedures in SQL Lab. When you try to explore it, it fails. This is caused by a syntax error, because Superset tries to wrap the EXEC call like so: "FROM ( EXEC... )".
Anything preceded by "precode-" will be extracted from the "FROM ( ... )" statement, and prepended onto the query, so that the final query will look something like this:
I'm sure there are some improvements that could be made, but hopefully someone will find this proof of concept useful. |
Beta Was this translation helpful? Give feedback.
-
I found little convenient way to let superset run mssql stored procedure execution.
print @finalsql
select * from #result |
Beta Was this translation helpful? Give feedback.
-
Make sure these boxes are checked before submitting your issue - thank you!
Superset version
0.17.3
Expected results
It would be good if it was possible to use SQLLab to create a slice generated from the execution of a stored procedure when working with MSSQL, via invocation with the exec keyword or with the call keyword in MySQL. Support for dynamically passing arguments would be required and perhaps cold be achieved using Jinja2 as Mode Analytics does with liquid.
https://help.modeanalytics.com/articles/add-parameters-to-reports/
Actual results
N/A
Steps to reproduce
N/A
Beta Was this translation helpful? Give feedback.
All reactions