Make Output Structures on SQL Queries not mandatory

By Ana Reis on 18 Jul

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.

Hanno15 Nov

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
Claring16 Nov

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
Kilian Hekhuis17 Nov (4 weeks ago)

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
Hanno22 Nov (4 weeks ago)

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
Claring23 Nov (3 weeks ago)

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
Hanno4 Dec (13 days ago)

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
Kilian Hekhuis5 Dec (12 days ago)

@Hanno: done, thanks for the heads up.

Hanno5 Dec (12 days ago)

No problem Kilian :)

J.7 Dec (10 days ago)

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..