Groups | Blog | Home
all groups > sql server reporting services > july 2006 >

sql server reporting services : Oracle Stored Procedure Syntax


John W at Sungard HE
7/28/2006 2:00:02 PM
I'd like to write a report with a data set that calls an Oracle data source
for its result set. I have a package with a procedure that returns a ref
cursor as an out variable. What is the syntax for calling this procedure
from the Report Designer? Does the out variable with the cursor need to be
mapped to anything? Are input parameters on the procedure anything other
than regular @parameter references?

rwiethorn
7/31/2006 5:07:02 AM
John,
The sql syntax is identical to the that used for MS SQL Server, except for
the @. Switch it to a : (colon)
and the parameters will work just fine, example:
Select Blah
From tblBlah
where Blah.tblBlah = :param

I like to use the IN Keyword. If you set your parameters as multi-select,
the parameters are passed in as an string seperated by commas, so your Where
clause would look like this:
Where Blah.tblBlah IN (:Param)

Hope this helps,
rwiethorn


[quoted text, click to view]
Aruna Muthyala
7/31/2006 5:15:14 AM
Hi,

Continuing with John's question, I want to know, What is the syntax for
calling the oracle stored procedure from the Report Designer? My procedure is
returning a ref cursor as an out variable.

Regards,
Aruna

[quoted text, click to view]
John W at Sungard HE
7/31/2006 5:23:02 AM
Thanks for the response - the bit with the parameters defintely helps. Do
you have an example that references a stored procedure instead of a select
statement? For example, do I have to wrap the procedure call in a PL/SQL
block like:

BEGIN
CallSomeProcedure( :InputParm1, :InputParm2, :OutputParm )
END

or is it sufficient to call the procedure without the block like:

CallSomeProcedure( :InputParm1, :InputParm2, :OutputParm )

And is the above parameter syntax going to work? What about the output
parameter that accepts the cursor back from the stored procedure? Is that
just set up as a report parameter like any other, even though it's an output
parameter? Does it matter where the output parameter is placed in the call
list, i.e. does it need to appear either first or last?

Thanks!

JW

[quoted text, click to view]
gene.furibondo NO[at]SPAM gmail.com
7/31/2006 6:46:24 AM
change the command type to stored procedure.

The syntax then looks like this

packagename.procedurename

no need to put any parameters in here.

[quoted text, click to view]
rwiethorn
7/31/2006 6:51:03 AM
John,
I'm a MS SQL Server guy myself, so I'm limited on the Oracle. I have a
Oracle DBA that makes tables for me when I define my sql statement. I've not
had the need to do any processing, I'm been only needing simple selects with
groupings.

[quoted text, click to view]
I think you can do with out it, the system may just 'swallow' the return
value (ie a 0 or 1) indicating a success or failure.

[quoted text, click to view]
Yes, parameter order does matter when your calling stored procs, you need to
match the order and the data type.

I hope this helps,
rwiethorn

[quoted text, click to view]
YK
8/4/2006 9:56:01 AM
Sorry, I did not get it. How I can send an OUT parameter (CURSOR) and use it
to generate report?

Thank you

[quoted text, click to view]
YK
8/4/2006 9:59:02 AM
Sorry, can I have more details, please. Like, what driver did you use, did
you use parameters Tab to set parameter and so on.

Thank you

[quoted text, click to view]
AddThis Social Bookmark Button