Feb 22, 2012 3:21 PM
Calling parameterized nz stored procedure from MS Sql Svr Rpting Svcs?
-
Like (0)
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
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.
Thanks for the reply. The @SP_SELECT... is just one of the variable names I've been trying.
I realize this should be fairly straightforward, but there's something about the interaction between SSRS and Netezza that's throwing me. A query works, calling the procedure without a parameter works, calling the procedure with a hard-coded param value works...it's just this specific method that doesn't work for me - some luck, huh?
I appreciate the input; hopefully someone somewhere has done exactly what I'm trying to do and has already gotten past whatever the magic key is. It would seem that SSRS-Netezza users are few and far between...
Thanks again~

