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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Bodo
Helper I
Helper I

How to use parameters in report builder with a Postgresql DB using odbc?

Hi all,

 

I am having problems using a parameter in a paginated report with a postgresql database.
I am using an ODBC connection to connect to postgresql.

 

This is the test query I am using:

 

 

with my_data as (
      select 0001 as customer_number, 'New York' as city 
union select 0002 as customer_number, 'Paris' as city
)
select 
    * 
from 
    my_data
where 
    city = (@city)

 

 


When I run the script, I get this error message:
An error occurred while executing the query.
ERROR [42883] ERROR: operatot does not exist: @ text;
Error while executing the query


This query works fine for an Orcale DB using this syntax:

 

 

where 
    city = (:city)

 

 

 

But this also fails for Postgres.

 

Can anyone tell me how the synax for using a parameter in the report builder is if using a Postgres DB?

Thanks in advance

1 ACCEPTED SOLUTION
Bodo
Helper I
Helper I

Alright, 

 

I have found a solution to my problem with external help now. With an ODBC connection parameters are created by using the questionmark sign (?). But you are not allowed to use any namens for the parameters anymore.

 

If you use ? in your SQL, parameters are automatically created in the report builder.
You have to pay attention to the order of the parameters and you are not allowed to rename it afterwards.

Here's an example which works for me:

Bodo_0-1688114681739.png

 

View solution in original post

1 REPLY 1
Bodo
Helper I
Helper I

Alright, 

 

I have found a solution to my problem with external help now. With an ODBC connection parameters are created by using the questionmark sign (?). But you are not allowed to use any namens for the parameters anymore.

 

If you use ? in your SQL, parameters are automatically created in the report builder.
You have to pay attention to the order of the parameters and you are not allowed to rename it afterwards.

Here's an example which works for me:

Bodo_0-1688114681739.png

 

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.