Know more about structure
Question

Can we say that structures are the equal to views which we have in SQL. ? If no,  how it is different than view? 

HI Nehe

A Structure is a compound data type used to encapsulate groups of related attributes,

 it can be used in sql views , api input and output a....etc

https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Data/Data_Types/Structure



Hi Neha Sheikh,


Structures is a definition of data type. In a structure, you can have Basic Types, Lists, Entities and other Structures (no recursion).

In a SQL query, you have to define a structure that matches the output of the query.


Example:

Imagine that you have the following Entity in the DataBase with some attributes

Sample_Employee: Id, FirstName, LastName, BirthDate, Email, Phone, Bio, HiringDate, Office, Picture, Filename, JobPosition, Department, Manager, Address, City, ZipCode, IsActive.

If you just want to know a list of hiring dates, you can define a structure with 2 Text fields and 1 Date field:

Hiring_Dates: FirstName (Text), LastName (Text), HiringDate (Date)

And do the following query:

SELECT FirstName, LastName, HiringDate

FROM Sample_Employee;


I hope that you can find this solution helpful.

IF you have more questions, let me know.

Regards,

Diogo Reis

Also, from my experience, SQL views from external databases are seen as Entities in OutSystems. This means you can use them in aggregates, filter/sort and also use their definition in structures.


Hope it helps,

Bogdan

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