On 01/06/2021 07:59, Alex Peshkoff via Firebird-devel wrote: > On 5/31/21 10:21 PM, Adriano dos Santos Fernandes wrote: > >> >>> As the second, unrelated change, shorten EXECUTE >>> PROCEDURE/STATEMENT/what-else OBJECT to EXEC OBJECT and decide about >>> object type from context - provided it will not raise the hell in >>> btyacc. >>> >> I do not understood what you mean. > > Now: EXECUTE PROCEDURE PROC1 .... (other parameters) > Suggested alternate syntax: EXEC PROC1 .... (other parameters) > > Now: EXECUTE STATEMENT 'SQL-text' .... (other parameters) > Suggested alternate syntax: EXEC 'SQL-text' .... (other parameters) > > Change is trivial - the only problem I see is does btyacc agree with > such syntax or not. >
This syntax is ambiguous: EXEC something something may be a procedure or a variable. Of course semantically everything can be done, but PSQL has not such dynamic rules as C++, nor I think it will be good to have or not a variable in scope change a command completely. If we wanted such rules, we could instead allow to call procedures with the function syntax as statement, and if it exist, call the procedure. With the same problems, as a function with the same name may be later created. Of course, I don't want that. Adriano Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel