Access stored procedures return value

Stimulsoft Ultimate discussion
Post Reply
keris
Posts: 22
Joined: Fri Oct 04, 2013 10:14 am

Access stored procedures return value

Post by keris »

How can I access the return value of a stored procedure in a report ?

Sample:

CREATE PROCEDURE SomeSP
AS
declare @rows int = (Select Count(*) from someTable)
Select TOP 100 from someTable
return (@rows)
END;

In that case I want to display the returned @rows count in the report.

Thanx
peter
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Access stored procedures return value

Post by Alex K. »

Hello,

As a way, try to use the following procedure:
...
declare @rows int = (Select Count(*) from someTable)
Select TOP 100 *, @rows from someTable
...
Thank you.
keris
Posts: 22
Joined: Fri Oct 04, 2013 10:14 am

Re: Access stored procedures return value

Post by keris »

Hi Aleksey,

that generates too much oveerhead. The use case for that handling deals with large row count.

Is there maybe a hook/event or override in the report where i can add an additional parameter with direction ReturnValue ?

Thanx
Peter
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Access stored procedures return value

Post by Alex K. »

Hello,

Unfortunately, the output parameters does not supported.
As a way you can add additional datasource in report in which calculate a row count in table.
Select Count(*) as rowCount from someTable

Thank you.
keris
Posts: 22
Joined: Fri Oct 04, 2013 10:14 am

Re: Access stored procedures return value

Post by keris »

Hello,
I've choosen your proposal to add an additional column to the result set. That's less overhaed as initially expected.
Thanx
Peter
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Access stored procedures return value

Post by Alex K. »

Hello,

Let us know if you need any additional help.

Thank you.
Post Reply