cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Community Discussions
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Stored Procedure creation in Unity Catalog

harman
New Contributor II

Does Databricks support the direct creation of stored procedures using the CREATE PROCEDURE syntax?

7 REPLIES 7

-werners-
Esteemed Contributor III

AFAIK databricks does not have stored procedures, but sql queries can be stored and executed, which is kinda the same.

SergeRielau
Valued Contributor
Valued Contributor

No stored procedures at this point. Have you looked at Notebooks?
If so and you still think you need/want stored procedures I would very much like to learn about it:

  • Is this a migration (from where)
  • Which features of procedures do you need? 

-werners-
Esteemed Contributor III

affirmative, notebooks are imo a (better) replacement for SPs

harman
New Contributor II

We have a requirement to retrieve records dynamically based on parameters from multiple tables via an external application using an API.

SergeRielau
Valued Contributor
Valued Contributor

Are you saying you need to "glue together" the query dynamically.
Thsi requires logic and it all has to fit into a JDBC call?
I.e. you need a CALL statement which hides the complexity?

harman
New Contributor II

Yes, I need to dynamically prepare the query using parameters, execute it on the Unity catalog, and display the results in the application's UI screen. That's why I want to write the logic in a stored procedure and call it.

-werners-
Esteemed Contributor III

there is a sql api, which can run sql queries but also a job rest api which launches a job. this job can run one or more notebooks.

https://docs.databricks.com/en/sql/admin/sql-execution-tutorial.html

https://docs.databricks.com/api/workspace/jobs