On 15-08-2022 19:42, Vlad Khorsun wrote:
Also, I don't like 'sql' word, especially after 'execute statement'
and 'execute
block'. Too much, as for me :) Syntax with 'with' instead of 'execute
sql' looks
much better to me, but it is already used in CTE's, thus it seems as not
the best
choice :(
Personally, I do like the EXECUTE SQL for its explicitness, and it fits
in the EXECUTE PROCEDURE and EXECUTE BLOCK naming; it is slightly a
mismatch/confusing with EXECUTE STATEMENT though.
An alternative could be to extend the EXECUTE BLOCK syntax for this so
it has a simplified form, without a RETURNS clause.
So, it has two forms:
EXECUTE BLOCK [(<param>, ...)]
[RETURNS (<param>, ...)]
AS
[<declarations>]
BEGIN
[<statement> ...]
END
and the simplified form
EXECUTE BLOCK [(<param>, ...)]]
AS
[<declarations>]
DO
<dsql-dml-statement>
Syntactically, the simplified form could be distinguished by the DO
instead of the BEGIN. Presence of the RETURNS clause with DO would raise
an error (maybe easiest is to allow it in the parse.y syntax, but raise
an error when its present).
A downside of this is that statement recognition by clients that
currently just look for EXECUTE BLOCK might break.
Mark
--
Mark Rotteveel
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel