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

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_Fatma
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.

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