Subject Re: [Firebird-Architect] Exec. statement parameters
Author Alex Peshkov
On Tuesday 11 December 2007 12:43, Adriano dos Santos Fernandes wrote:
> And my arguments is that something like following
> code should be allowed:
> execute block
> as
> begin
> insert into t values (:p, :p);
> end
>
> instead of:
> execute block (p integer = :p)
> as
> begin
> insert into t values (:p, :p);
> end

Yes, it also looks better for me.

> and also that named parameters (of exec. stmt) should be care to not
> cause future problems like:
> execute block (p1 integer = :p2, p2 integer = :p1)
> as
> begin
> insert into t values (:p1, :p2);
> end

In exec stmt it will never happen. Call in form parameter=value - or
parameter(value) - is supposed to be outside of SQL string, therefore I do
not see possible ambiguties here. Certainly, one can write:

Execute Statement 'la-la-la ... :a ... :b ...' (a(b), b(a));

but this will not mean bad syntax of named parameters - only brain damage of a
person writing in such a way:) Parameters substitution will anyway happen
correctly.