Create the output structure (in advanced queries) based on the select statement
4172
Views
39
Comments
Not right now
Aggregates & Queries

right click on "output structure" >> Create the output structure (in advanced queries) based on the select statement

Merged this idea with 'Automatic generation of output structures to advanced queries' (created on 20 Jun 2014 12:05:21 by Bruno Lourenço)
Add an extra option when choosing the output structure, to automatically create a new one based on the attributes on the select clause of the query.

This comment was:
- originally posted on idea 'Automatic generation of output structures to advanced queries' (created on 20 Jun 2014 by Bruno Lourenço)
- merged to idea 'Create the output structure (in advanced queries) based on the select statement' on 19 May 2021 03:22:12 by Justin James
Bruno - Version 9 makes this unnecessary. :)

J.Ja


This comment was:
- originally posted on idea 'Automatic generation of output structures to advanced queries' (created on 20 Jun 2014 by Bruno Lourenço)
- merged to idea 'Create the output structure (in advanced queries) based on the select statement' on 19 May 2021 03:22:12 by Justin James

This will be really time/effort saving. 

There should be an option to create dummy structure for non select queries.

I was also about to add same idea. Thanks man.



This comment was:
- originally posted on idea 'Automatic generation of output structures to advanced queries' (created on 20 Jun 2014 by Bruno Lourenço)
- merged to idea 'Create the output structure (in advanced queries) based on the select statement' on 19 May 2021 03:22:12 by Justin James
Merged this idea with 'Create structure from SQL query' (created on 18 May 2021 22:36:07 by José Gonçalves)

This comment was:
- originally posted on idea 'Automatic generation of output structures to advanced queries' (created on 20 Jun 2014 by Bruno Lourenço)
- merged to idea 'Create the output structure (in advanced queries) based on the select statement' on 19 May 2021 03:22:12 by Justin James

With a simple button "Create Structure" in the SQL, a lot of time could be saved building automatically a structure that is read from the query fields:




This comment was:
- originally posted on idea 'Create structure from SQL query' (created on 18 May 2021 by José Gonçalves)
- merged to idea 'Automatic generation of output structures to advanced queries' on 19 May 2021 03:19:56 by Justin James


This comment was:
- originally posted on idea 'Automatic generation of output structures to advanced queries' (created on 20 Jun 2014 by Bruno Lourenço)
- merged to idea 'Create the output structure (in advanced queries) based on the select statement' on 19 May 2021 03:22:12 by Justin James
Merged this idea with 'Automatic creation of structures when working with Advanced SQL Queries' (created on 14 Oct 2016 22:02:48 by SamyCode)

This comment was:
- originally posted on idea 'Automatic generation of output structures to advanced queries' (created on 20 Jun 2014 by Bruno Lourenço)
- merged to idea 'Create the output structure (in advanced queries) based on the select statement' on 19 May 2021 03:22:12 by Justin James

I can have an advanced SQL query that selects more than 10 columns, and maybe I would want only to test some behavior, and I cannot do so if I don't create a structure first. Then, if something changes (and it normally does) I have to go and edit the structure again. Structure creation should be automatically, based on the Advanced SQL Query output.



This comment was:
- originally posted on idea 'Automatic creation of structures when working with Advanced SQL Queries' (created on 14 Oct 2016 by SamyCode)
- merged to idea 'Automatic generation of output structures to advanced queries' on 19 May 2021 03:20:45 by Justin James


This comment was:
- originally posted on idea 'Automatic generation of output structures to advanced queries' (created on 20 Jun 2014 by Bruno Lourenço)
- merged to idea 'Create the output structure (in advanced queries) based on the select statement' on 19 May 2021 03:22:12 by Justin James
2014-02-07 17-02-43
Vasco Pessanha
Merged this idea with 'Auto-create Output Entities / Structures for Custom SQL Statements' (created on 05 Jul 2018 15:12:17 by PJ M)

This comment was:
- originally posted on idea 'Automatic creation of structures when working with Advanced SQL Queries' (created on 14 Oct 2016 by SamyCode)
- merged to idea 'Automatic generation of output structures to advanced queries' on 19 May 2021 03:20:45 by Justin James


This comment was:
- originally posted on idea 'Automatic generation of output structures to advanced queries' (created on 20 Jun 2014 by Bruno Lourenço)
- merged to idea 'Create the output structure (in advanced queries) based on the select statement' on 19 May 2021 03:22:12 by Justin James
UserImage.jpg
PJ M

since you know which tables and fields are coming back for the SQL statement, you can automatically create the output structure for the SQL statement. If you don't know the type of data in a field, make it a TEXT type. But if I do something like this:

select {Car}.[Id] as CarId, {Owner}.[Id] as OwnerId from

{Car} inner join {Owner} on {Car}.[OwnerId] = {Owner}.[Id]


You know the structure will be like this:

CarOwner{

CarId: CarIdentifier,

OwnerId: OwnerIdentifier

}


OS doesn't need to make me manually create that structure and add it to the SQL Statement. This will save SOOO much time.



This comment was:
- originally posted on idea 'Auto-create Output Entities / Structures for Custom SQL Statements' (created on 05 Jul 2018 by PJ M)
- merged to idea 'Automatic creation of structures when working with Advanced SQL Queries' on 14 Sep 2018 08:47:16 by Vasco Pessanha


This comment was:
- originally posted on idea 'Automatic creation of structures when working with Advanced SQL Queries' (created on 14 Oct 2016 by SamyCode)
- merged to idea 'Automatic generation of output structures to advanced queries' on 19 May 2021 03:20:45 by Justin James


This comment was:
- originally posted on idea 'Automatic generation of output structures to advanced queries' (created on 20 Jun 2014 by Bruno Lourenço)
- merged to idea 'Create the output structure (in advanced queries) based on the select statement' on 19 May 2021 03:22:12 by Justin James
Changed the category to
Aggregates & Queries


This comment was:
- originally posted on idea 'Auto-create Output Entities / Structures for Custom SQL Statements' (created on 05 Jul 2018 by PJ M)
- merged to idea 'Automatic creation of structures when working with Advanced SQL Queries' on 14 Sep 2018 08:47:16 by Vasco Pessanha


This comment was:
- originally posted on idea 'Automatic creation of structures when working with Advanced SQL Queries' (created on 14 Oct 2016 by SamyCode)
- merged to idea 'Automatic generation of output structures to advanced queries' on 19 May 2021 03:20:45 by Justin James


This comment was:
- originally posted on idea 'Automatic generation of output structures to advanced queries' (created on 20 Jun 2014 by Bruno Lourenço)
- merged to idea 'Create the output structure (in advanced queries) based on the select statement' on 19 May 2021 03:22:12 by Justin James

perhaps a duplicate of this idea https://www.outsystems.com/ideas/2682/Automatic+creation+of+structures+when+working+with+Advanced+SQL+Queries



This comment was:
- originally posted on idea 'Auto-create Output Entities / Structures for Custom SQL Statements' (created on 05 Jul 2018 by PJ M)
- merged to idea 'Automatic creation of structures when working with Advanced SQL Queries' on 14 Sep 2018 08:47:16 by Vasco Pessanha


This comment was:
- originally posted on idea 'Automatic creation of structures when working with Advanced SQL Queries' (created on 14 Oct 2016 by SamyCode)
- merged to idea 'Automatic generation of output structures to advanced queries' on 19 May 2021 03:20:45 by Justin James


This comment was:
- originally posted on idea 'Automatic generation of output structures to advanced queries' (created on 20 Jun 2014 by Bruno Lourenço)
- merged to idea 'Create the output structure (in advanced queries) based on the select statement' on 19 May 2021 03:22:12 by Justin James
2014-02-07 17-02-43
Vasco Pessanha
Merged this idea with 'Advanced SQL Structure Suggestion' (created on 07 Sep 2018 06:25:58 by JitendraYadav)

This comment was:
- originally posted on idea 'Auto-create Output Entities / Structures for Custom SQL Statements' (created on 05 Jul 2018 by PJ M)
- merged to idea 'Automatic creation of structures when working with Advanced SQL Queries' on 14 Sep 2018 08:47:16 by Vasco Pessanha


This comment was:
- originally posted on idea 'Automatic creation of structures when working with Advanced SQL Queries' (created on 14 Oct 2016 by SamyCode)
- merged to idea 'Automatic generation of output structures to advanced queries' on 19 May 2021 03:20:45 by Justin James


This comment was:
- originally posted on idea 'Automatic generation of output structures to advanced queries' (created on 20 Jun 2014 by Bruno Lourenço)
- merged to idea 'Create the output structure (in advanced queries) based on the select statement' on 19 May 2021 03:22:12 by Justin James

Hi Team,


Please gives us option in advanced SQL to auto suggest/create relevant structure with the same definition.


Thanks!



This comment was:
- originally posted on idea 'Advanced SQL Structure Suggestion' (created on 07 Sep 2018 by JitendraYadav)
- merged to idea 'Auto-create Output Entities / Structures for Custom SQL Statements' on 14 Sep 2018 08:46:37 by Vasco Pessanha


This comment was:
- originally posted on idea 'Auto-create Output Entities / Structures for Custom SQL Statements' (created on 05 Jul 2018 by PJ M)
- merged to idea 'Automatic creation of structures when working with Advanced SQL Queries' on 14 Sep 2018 08:47:16 by Vasco Pessanha


This comment was:
- originally posted on idea 'Automatic creation of structures when working with Advanced SQL Queries' (created on 14 Oct 2016 by SamyCode)
- merged to idea 'Automatic generation of output structures to advanced queries' on 19 May 2021 03:20:45 by Justin James


This comment was:
- originally posted on idea 'Automatic generation of output structures to advanced queries' (created on 20 Jun 2014 by Bruno Lourenço)
- merged to idea 'Create the output structure (in advanced queries) based on the select statement' on 19 May 2021 03:22:12 by Justin James
2014-02-07 17-02-43
Vasco Pessanha
Changed the category to
Aggregates & Queries


This comment was:
- originally posted on idea 'Advanced SQL Structure Suggestion' (created on 07 Sep 2018 by JitendraYadav)
- merged to idea 'Auto-create Output Entities / Structures for Custom SQL Statements' on 14 Sep 2018 08:46:37 by Vasco Pessanha


This comment was:
- originally posted on idea 'Auto-create Output Entities / Structures for Custom SQL Statements' (created on 05 Jul 2018 by PJ M)
- merged to idea 'Automatic creation of structures when working with Advanced SQL Queries' on 14 Sep 2018 08:47:16 by Vasco Pessanha


This comment was:
- originally posted on idea 'Automatic creation of structures when working with Advanced SQL Queries' (created on 14 Oct 2016 by SamyCode)
- merged to idea 'Automatic generation of output structures to advanced queries' on 19 May 2021 03:20:45 by Justin James


This comment was:
- originally posted on idea 'Automatic generation of output structures to advanced queries' (created on 20 Jun 2014 by Bruno Lourenço)
- merged to idea 'Create the output structure (in advanced queries) based on the select statement' on 19 May 2021 03:22:12 by Justin James
Merged this idea with 'Create/update a new structure from a SQL query' (created on 09 Mar 2018 14:31:51 by Daniel Asserati)

This comment was:
- originally posted on idea 'Automatic generation of output structures to advanced queries' (created on 20 Jun 2014 by Bruno Lourenço)
- merged to idea 'Create the output structure (in advanced queries) based on the select statement' on 19 May 2021 03:22:12 by Justin James

It is often a pain to write or update structures that are required for use in SQL queries so would be ideal to be able to write the SQL and as long as it is valid, be able to create a structure off of the Select statement.  The update may be more of a challenge but if done well it could ensure consistency between columns in structures vs query.



This comment was:
- originally posted on idea 'Create/update a new structure from a SQL query' (created on 09 Mar 2018 by Daniel Asserati)
- merged to idea 'Automatic generation of output structures to advanced queries' on 19 May 2021 03:21:41 by Justin James


This comment was:
- originally posted on idea 'Automatic generation of output structures to advanced queries' (created on 20 Jun 2014 by Bruno Lourenço)
- merged to idea 'Create the output structure (in advanced queries) based on the select statement' on 19 May 2021 03:22:12 by Justin James
2014-02-07 17-02-43
Vasco Pessanha
Changed the category to
Aggregates & Queries


This comment was:
- originally posted on idea 'Create/update a new structure from a SQL query' (created on 09 Mar 2018 by Daniel Asserati)
- merged to idea 'Automatic generation of output structures to advanced queries' on 19 May 2021 03:21:41 by Justin James


This comment was:
- originally posted on idea 'Automatic generation of output structures to advanced queries' (created on 20 Jun 2014 by Bruno Lourenço)
- merged to idea 'Create the output structure (in advanced queries) based on the select statement' on 19 May 2021 03:22:12 by Justin James

duplicate of this idea https://www.outsystems.com/ideas/2682/Automatic+creation+of+structures+when+working+with+Advanced+SQL+Queries



This comment was:
- originally posted on idea 'Create/update a new structure from a SQL query' (created on 09 Mar 2018 by Daniel Asserati)
- merged to idea 'Automatic generation of output structures to advanced queries' on 19 May 2021 03:21:41 by Justin James


This comment was:
- originally posted on idea 'Automatic generation of output structures to advanced queries' (created on 20 Jun 2014 by Bruno Lourenço)
- merged to idea 'Create the output structure (in advanced queries) based on the select statement' on 19 May 2021 03:22:12 by Justin James
Merged this idea with 'Structure Output Advanced Queries' (created on 18 Jan 2020 09:18:11 by Sílvia Sendim)

When we do an advanced querie automatically generate an generic output structure matching with the selected attributes.



This comment was:
- originally posted on idea 'Structure Output Advanced Queries' (created on 18 Jan 2020 by Sílvia Sendim)
- merged to idea 'Create the output structure (in advanced queries) based on the select statement' on 19 May 2021 03:24:22 by Justin James
Changed the status to
Not right now

Hi Ricardo, 

Thanks for submitting the idea.

Although we do understand that this capability can reduce some steps creating an SQL node but unfortunately is not an area that we are prioritizing for the next couple of quarters.

I will mark the idea as "not right now" and keep monitoring the traction on the community.


Thanks,

Merged this idea with 'Generate structure based on advanced SQL output' (created on 20 Apr 2022 14:26:11 by Stefano Valente)

Sometimes when you need that specific output, the only way is to create an advanced SQL.

This requires an output structure that matches the output of the query.

My current way of work is to write the SQL, then go to data tab and create the structure needed. Go back to the advanced SQL and add the structure.


The idea:

Add a function in the Create Advanced SQL "Create structure based on current SQL".


This would help save some time. Perhaps after this we can also have the option to update the current structure when the SQL had changed.

 

Hi Stefano Valente,

Great findings, it will be really helpful once it got implemented.

Regards,

Sreejith Surendran

Really good Thought and will Great help for Oustsystems Dev

This would be a good accelerator 

this accelerator would be welcome, because today we have to assemble the structure.


This frustration, that I share with you, has been around since 2010, see this idea.

I fully agree that this would be a good accelerator!!


Regards

Also adding my 2 ct that I think this would make the life of a developer a lot easier. It would make the flow of development a lot easier.

Also to be able to show test results without having a correct data mapping in the first place, but I bet there is another idea for that.

Merged this idea with 'Automatic structure creation for an advanced SQL output' (created on 17 Feb 2023 07:11:07 by Thibaut G)

The option to create a structure in one click that matches the current advanced query output.

e.g. I have  a query that returns 5 columns with datatype text -> press button -> creates a structure with 5 text attributes.

Hi Thibaut,

Though not possible directly, there's a workaround: first, create a Local Variable, and via the Data Type dropdown select "SQL1 Record Type" (where "SQL1" is the name of your SQL). Next, right-click the local variable for the context menu, and select "Create Structure from Data Type", and a structure will be created (and the local variable will get that structure as its Data Type). This also works with Aggregates. Note that if the SQL or Aggregate only returns a single Entity, the "Create Structure from Data Type" is not possible, as the data type of the local variable will already be the Entity Record, instead of a Record with entity records.

@Thibaut G ,

see also this idea, it has existed for more than 12 years, and has been labeled as 'not right now', so I wouldn't expect anything to change soon.  Maybe go like that idea, maybe it can be merged...

and there are lots of similar or related ideas, search the ideas section with 'sql output' if you are interested.

@Kilian Hekhuis , that sounded interesting, so i wanted to try, but I can't manage it, the option "SQL1 Type" in the dropdown only appears after i have already choosen a (set of) existing structures or entities as output for my SQL, so this doesn't help solve the annoying part where i have to go into data tab and carefully construct a structure to match my SQL.

1) sql widget with some query, no outputs defined : SQL1 structure is not part of suggestions

2) after manually creating a structure to match the output of the sql and setting it as the sql output : this is when SQL1 structure appears as option for the local variable




@Dorine Boudry I see what you mean. I think the OP indeed meant something different from what I thought he did. You do need to define an output, which may be a bunch of Entity records, and then it works. But I see now the OP probably meant that SS should do it from the "SELECT" statement instead.

EDIT: I agree it's the same as that other Idea you mentioned, so I'm going to merge them.

Merged this idea with 'Suggestion of automatically create structure in Sql ' (created on 14 Feb 2022 20:00:36 by Akshay Deshpande)

It will be really helpful, if we write some SQL query on that bases we get automatically suggestion for output structure similar like API response Example .

SQL query Ex.  Select Entity.name, Entity. Surname from Entity 

Then give suggestion of structure with two attribute(name-text, surname-text ) and if we proceed than its created automatically structure

Because right now, if there are 3,4 entity and from that entity we are getting 7,8 attribute record then we need to create structure then pass as output and the process.
So, if this idea will implement then, it will be good to work of such scenario.

Changed the category to
Aggregates & Queries

It's a good idea.

For example, It can be like generating structures through a JSON.