Advanced Query without output
2202
Views
17
Comments
On our RadarOn our Radar
Aggregates & Queries
Advance queries should have a property where we could say that it does not have an output.
This should remove the need to assign an output structure in a delete or update statement.
In the case of Update, Delete, it is helpful for it to return "boolean" so that you know if the query failed or not.
If it fails, you get an exception ;)

This is still a much needed improvement.

Merged this idea with 'Make Output Structures on SQL Queries not mandatory' (created on 18 Jul 2017 11:57:17 by Ana Reis)
2019-11-25 11-21-58
Ana Reis
 
MVP

It is frequent to use SQL Queries to perform operations like updates or deletes that do not require an output structure. For those cases we need to add a random structure as output to remove the error. My proposal is to make the output not mandatory.

It should not be required to define an output structure when my advanced query is only a DELETE FROM statement



Merged from 'Advanced SQL Delete statement no output' (idea created on 2017-11-15 21:27:51 by Hanno), on 2017-12-05 08:07:35 by Kilian Hekhuis

I think by default a DELETE statement returns the number of rows deleted, which might be why you need a output struct.



Merged from 'Advanced SQL Delete statement no output' (idea created on 2017-11-15 21:27:51 by Hanno), on 2017-12-05 08:07:35 by Kilian Hekhuis

It's not why you need the output structure, as you can specify any structure you want. It's more that the SQL parser is not smart enough to detect there's no SELECT in there.



Merged from 'Advanced SQL Delete statement no output' (idea created on 2017-11-15 21:27:51 by Hanno), on 2017-12-05 08:07:35 by Kilian Hekhuis

I guess the same would apply to an UPDATE-only statement. 

I concede that you might want to use the number of rows affected, but in that case, an output structure would be specified.



Merged from 'Advanced SQL Delete statement no output' (idea created on 2017-11-15 21:27:51 by Hanno), on 2017-12-05 08:07:35 by Kilian Hekhuis

Agreed, perhaps a warning could be added to say something like "This sql statement does not have any output structures defined."



Merged from 'Advanced SQL Delete statement no output' (idea created on 2017-11-15 21:27:51 by Hanno), on 2017-12-05 08:07:35 by Kilian Hekhuis

Just noticed that there was already an idea for this here

Moderators please can you merge the ideas.



Merged from 'Advanced SQL Delete statement no output' (idea created on 2017-11-15 21:27:51 by Hanno), on 2017-12-05 08:07:35 by Kilian Hekhuis

@Hanno: done, thanks for the heads up.

No problem Kilian :)

2016-04-21 20-09-55
J.
 
MVP

it affects the truechange, so I am against it.

however I agree with the "dummy" structure issue with non-query sql.

Not sure if a new element will be the solution..


Merged this idea with 'Advanced SQL Delete statement no output' (created on 2017-11-15 21:27:51 by Hanno)
Merged this idea with 'Suggestion on SQL Tool' (created on 21 Jun 2020 14:49:55 by Mahesh Manchala)

I hope its not required to mandate dummy output structure or Entity while deleting . Its my opinion to consider for further refactoring.




This comment was:
- originally posted on idea 'Suggestion on SQL Tool' (created on 21 Jun 2020 by Mahesh Manchala)
- merged to idea 'Make Output Structures on SQL Queries not mandatory' on 25 Jun 2020 10:18:30 by Daniël Kuhlmann