Hello Everyone, I have a question. Okay, per my requirements, I needed to perform an SQL union to retrieve the appropriate records needed for my use case. My question is, are Structures dynamic? Meaning, I will have a number of users performing an action that will pass input of parameters for this Advance query. Once these records are generated, there they would have to be summed up by each column. Would the best approach is to place these in a structure to achieve this. I am know that I cannot use an entity due to the fact that it is not dynamic but static but are structures dynamic?

Thanks in advance for your assistance.


Hi Otis,

You define structures, like entities, at design time in OutSystems.  If you use an advanced query where you want to count or sum over all or by group, then you need to define a structure with the same attributes and correct data type as the columns that you advanced query has as output columns. The structure you then have to select in the advanced query as output structure.

Then after the query you can access the query results as defined in the output structure.

Regards,

Daniel

Hi Otis,

Has Daniël said the structures are defined during development time. That means you need to be creative when you want to have dynamic SQL. 

I will describe what I already did for you to check if this can help you. I will recommend going this path if you really need and if you really know what are you doing since this a bit more complex stuff. This worked on a SQL server environment (never tested on Oracle)

You can create an advance query that returns JSON using  "FOR JSON AUTO". Than you can use that JSON to feed this component to show what was returned.

Regards,

Marcelo  

Thanks for all your help and assistance.