cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
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

5 REPLIES 5

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

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group