Skip navigation
970 Views 2 Replies Latest reply: Feb 22, 2012 10:14 PM by Gary Glover RSS
Gary Glover New Enzee 2 posts since
Jan 5, 2012
Currently Being Moderated

Feb 22, 2012 3:21 PM

Calling parameterized nz stored procedure from MS Sql Svr Rpting Svcs?

I'm a reporting specialist in Data Analytics using primarily SQL Server 2008 R2 with Reporting Services.

Our company just purchased a Netezza system and I have to convert existing Reporting Services reports so the datasets are populated by calling Netezza stored procedures.

I've successfully created a datasource using an OLEDB connection to NZ from within SSRS.

I have created a new report Dataset which uses the OLEDB datasource connection and specified the desired nz stored procedure name.

I have created a report parameter ( @SP_SELECT_REPLENISHMENT_ARG_1) and assigned it to the SSRS Dataset, which is where the SP to call is referenced.

 

The NZ stored procedure includes one INT parameter.

 

So what should happen when running the report:

a) a parameter prompt is displayed, allowing the entry of the desired value (or, if a set of values has been assigned, a selection is made via a drop-down list).

b) once the parameter value is entered, the dataset calls the specified NZ stored procedure, including in the call the associated integer parameter value.

 

The hangup is in the use of the report parameter.

I can successfully retrieve the data if I type in an explicit parameter value, e.g., EXEC DB_REPORTS.ADMIN.SP_SELECT_REPLENISHMENT(122).

 

What does NOT work is using the report parameter, e.g.,

EXEC DB_REPORTS.ADMIN.SP_SELECT_REPLENISHMENT(@SP_SELECT_REPLENISHMENT_ARG_1) .,,

 

I've tried various syntax permutations; none using the parameter variable work.

 

I've done searches and to date have not found anything which solves this problem.  I can't believe there's not some simple solution - but so far I've failed to find it.

 

If anyone has any advice, or has set up an SSRS parameterized report which calls a Netezza stored procedure, I would greatly appreciate it!

 

-ggg

  • nickg Active Enzee 250 posts since
    Mar 16, 2011

    I'm not familiar with SSRS specifically, but if you are using 'EXEC DB_REPORTS.ADMIN.SP_SELECT_REPLENISHMENT(@SP_SELECT_REPLENISHMENT_ARG_1) .,,' as the expression passed to the server, the server is not going to know what @SP_SELECT_REPLENISHMENT_ARG_1 is.  That needs to be resolved before sending the command to the server.  You need to create a string that builds the expression by concatenating the fixed text with the values represented by the parameters.  You then send that string to the server.

More Like This

  • Retrieving data ...

Bookmarked By (1)

Legend

  • Correct Answers - 4 points
  • Helpful Answers - 2 points