21
Views
13
Comments
Solved
SQL statement for Output structures
Application Type
Traditional Web

I have a output structure  and when I call it in the SQL statement it doesn't recognise it and only shows output entities rather than structures 

Rank: #171
Solution


Okay, to create data using a REST API, see the attached .OML example. 

I created an End Point REST in an application in my environment, and in its "SQL" application I created a button to load data into the ImageLocal table, consuming data from the REST (Get) of my environment. 


Hope this helps.

SQL.oml

Rank: #68

Hi Yats,


Can you provide a screenshot or more detail?

When you are defining the output structure, you are describing the mapping the results of your query will take (into structure(s) and/or entities) that you can use on your logic or screen after the query not in SQL Statement itself.

An SQL Statement is a command that will run in the database and therefore you only access Entities (which translate into database tables) and input parameters, not structures.


Regards,
João

Rank: #170

Hello Yats,

When you are in the advanced SQL editor, if you click with your right button in the output folder, you will see an option to add another type of outputs:


There you will be able to select any Entity or Structure as an OutPut.


Have you tried that?


Cheers and Regards,

RR :)

Rank: #461

Hi Yats,

Please provide more detailed information, So we can look into it.

Kindly Regards


Rank: #171

Hello Yats,

You can drag and drop your structure to the Advanced SQL, see the example:

Hope this helps.

Regards.

Rank: #35276

Thank you all for your response. I have attached an OML file with an image. I have already added the output structure but when I enter SELECT {Structure1} it doesn't recognise it.

SQL.oml

Rank: #171

Even if you define a structure as an output, you must select it from an existing table in the database, example:

Rank: #35276

I see ok. So is the database made in entity attribute, is that empty? 

Because essentially I am trying to export data from a Rest API, do you know how I would do that ?

Would I need to add data from a REST API in the database ?

Rank: #171


I believe so, to return values, you need to create records in your table in the database.

Rank: #35276

Hi Agno, I updated the last question. Thanks

Rank: #171
Solution


Okay, to create data using a REST API, see the attached .OML example. 

I created an End Point REST in an application in my environment, and in its "SQL" application I created a button to load data into the ImageLocal table, consuming data from the REST (Get) of my environment. 


Hope this helps.

SQL.oml

Rank: #35276

Thank you this is great, how do you then export it into a excel file?

Rank: #171
Rank: #403

Hi Yats,

You need to put an entity name into the select SQL tab. It seems you had  not added any entity and trying to assign values to the structure. I have added a new structure UserDetails and added 2 attributes to it and selected the attributes from {User} entity which is working fine. Please refer attached OML.

Thanks & Kind Regards,

Sachin

SQLSachin.oml