Search code examples
sqlpostgresqlreporting-services

SSRS Use Query Parameter in Query String PostgreSQL


How to use query parameter variable in the query string for a PostgreSQL database?

I have a report parameter Address that the user types the address. I then want to TRIM and make it upper case, so I created a Parameter in the Dataset Properties named USER_ADDRESS with an expression of TRIM(UCase(Parameters!Address.Value))

screenshot of report parameter

screenshot of query parameter

Previously, I had an oracle databsae and all of this worked by referencing the query parameter like:

SELECT * FROM table WHERE table.address = :USER_ADDRESS

But now that we're switching, the PostgreSQL doesn't like that syntax.


Solution

  • As per the comments, using a ? as an unnamed parameter for an ODBC connection worked.

    SELECT *  FROM table  WHERE table.address = ?
    

    Links: