How do I call an Oracle Stored Procdure from SSRS (VS 2008) and pass 2 parameters to the SP (e.g. BeginDate and EndDate)?
Any help will be greatly appreciated. I have struggled with how to accomplish this. I need to produce a report based on two parameters (BeginDate and EndDate) that are supplied. The data is in an Oracle database, and I would like to pass the 2 paramters to the Oracle stored procedure. When I attempt to use the 'call Ora_stored_proc(?,?), and define the '?'s to the @BeginDate and @EndDate report parameters, I get the error 'an error occurred while retreiving parameters in the query' with 'Ora-00911 invalid character', and 'Ora-6512 at sys.dbms_utility, line 114'. The same error occurs if I specify Oracle bind parameters (e.g. :begindate) that is mapped to the @BeginDate report parameter. What is the trick to accomplish this? Can someone provide an example of calling an Oracle stored procedure suppling input parameters? Thanks.
June 7th, 2010 10:08pm

hello, I have used Oracle procedures without any problems. here's how I do it: go in the dataset properties and change the query type to Stored Procedure and select the procedure. Then go to the parameters tab, the parameters of your query should be automatically loaded so just bind the values to your parameters and you should be good to go.
Free Windows Admin Tool Kit Click here and download it now
June 7th, 2010 10:32pm

A few things about SSRS & Oracle that I learned the hard way and which might help someone some day: 1. Newcomers to Oracle may not realize that Oracle's stored procedures don't return recordsets. You can still run them with parameters, but if this needs to occur before the other datasets are run, you can force this by setting the data source property "Use single transaction when processing the queries" (available at least in SSRS 2005 and 2008, I don't know about 2000). The data set physically first in the xml rdl file will be run before the others. 2. Try different providers. They work differently and offer different features and have different problems (meaning you might be able to work around some issue you're having by switching). 3. The OLE DB provider in SSRS, sample connection string "Provider=OraOLEDB.Oracle.1;Data Source=databaseserver" works with parameters that have a colon in front of them, not the 'at' symbol. For example, `SELECT * FROM MyTable WHERE Value = :MyValue`. 4. Take all inline comments out of your query. The query may not be submitted with new line characters intact, which destroys the query. 5. If you use the same parameter twice, give it a new name and bind both names to the same SSRS parameter. It isn't supported to use the same parameter name twice. Note that one big gotcha in SSRS 2005 is that every time you change the query (at least when using OLE DB to connect to Oracle), you'll lose all your parameters and have to re-enter them (welcome to a whole new world of torture).
December 20th, 2010 9:35pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics