Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
GrayMarshUK
Frequent Visitor

Paginated Report with Direct Connection to Databricks

I am in the process of creating a Paginated Report that is running direct queries to a databricks server using an ODBC connection.

 

When I try and add a Parameter to the query using "@" then the query is failing to validate and is reporting a syntax error.  If I remove the @ and replace it with a value then the query works fine.

 

I presume this is an issue with SQL code within databricks.  Has anybody come across this before got a solution?

2 REPLIES 2
v-cgao-msft
Community Support
Community Support

Hi @GrayMarshUK ,

What is your code for the parameter part?
In Databricks SQL, parameters are not prefixed with as in traditional SQL. Instead, they are enclosed in double curly braces .
Query parameters - Azure Databricks

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

This is a basic version of the query that works fine with Azure Warehouse
SELECT site, site_bk
FROM dev.cur_uki_commercial.commercial_dim_location
WHERE site = @customer

Tried the follwoing but still get an error
SELECT site, site_bk
FROM dev.cur_uki_commercial.commercial_dim_location
WHERE site ={{ @customer }}


GrayMarshUK_0-1699262637085.png

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.