cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

How can we pass parameters while scheduling queries in Databricks SQL?

Sajid1
Contributor
 
1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Sajid Thavalengal Rahimanโ€‹ 

When you write your query into DBSQL, just add a variable into brackets like this, it will add automatically the widget with the name given in the SQL Code (You can customize the type of your widget by clicking on the icon on the right of the widget):

image.pngimage

View solution in original post

6 REPLIES 6

Cami
Contributor III

Hello:)

How would you like pass a parameters and where? Is it ok for you to have value stored on the query level?

Did you checked documentation out?

What is your bussines case?

or perhaps this question resolve your issue

I had gone through the documentation, not explored the query-based dropdown list. However, can the users change the parameter value once the query is refreshed and dashboard is populated? Primarily, I am not sure of how to pass default values for parameters as i need to schedule the queries and get the dashboard populated.

PrasanthM
New Contributor III

Any string between double curly braces 

{{ }}

 is treated as a query parameter. widget  can be an option here.

How to create widget in sql warehouse query, not using a notebook so cannot use the dbutils to create widgets?

Hi @Sajid Thavalengal Rahimanโ€‹ 

When you write your query into DBSQL, just add a variable into brackets like this, it will add automatically the widget with the name given in the SQL Code (You can customize the type of your widget by clicking on the icon on the right of the widget):

image.pngimage

Kaniz
Community Manager
Community Manager

Hi @Sajid Thavalengal Rahimanโ€‹, We havenโ€™t heard from you since the last response from @Laurent Lรฉturgezโ€‹ โ€‹ โ€‹, and I was checking back to see if his suggestions helped you.

Or else, If you have any solution, please share it with the community, as it can be helpful to others.

Also, Please don't forget to click on the "Select As Best" button whenever the information provided helps resolve your question.