How to get procedure result (SELECT/OUTPUT)
Question

Hi.

I have a big problem. I have to execute a procedure that returns 2 results:
- A list of data
- Total pages and Total Rows


I need to know how is the way to put this result in OutSystems object.

Any idea?

I appreciate all help.

mvp_badge
MVP
Solution

Ah, ok, now I get your question.


You should create a structure with the output fields you expect and add that structure to the output of your query. Something like this:


Kind Regards,
João

mvp_badge
MVP

Hi Angelo,


Take a look at this tutorial post on how to do it.

As you can see in the instructions, you will need to grant special permissions to the OSRUNTIME user to run stored procedures. If you're working on OutSystems cloud you don't have the access to do this so if you really need this and if you're working on a cloud infrastructure, I would ask OutSystems support if this permission is granted or if not, if they can do it for you.


Kind Regards,
João

Hi João.

I can execute procedure. My problem is get the result and put in this output.

My procedure returns 2 resultsets.

Thanks for your help.

mvp_badge
MVP
Solution

Ah, ok, now I get your question.


You should create a structure with the output fields you expect and add that structure to the output of your query. Something like this:


Kind Regards,
João

Hello Angelo,

Made a two Structure First structure  for data only 

and second structure is for list of data and  Total pages and Total Rows as shown in Image 

And that main structure pass as output to the sql. In this way you will get 2 result list of data and Total pages, Total Rows.

May be this will helps you.

Thanks and Regards,

Akshay Deshpande


mvp_badge
MVP

Akshay,

That doesn't work, at all. You cannot use Structures with nested Structures or Lists as the output of an SQL.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.