Subject Re: [Firebird-Architect] Exec. statement parameters
Author Alex Peshkov
On Monday 10 December 2007 18:19, Adriano dos Santos Fernandes wrote:
> Vlad Khorsun escreveu:
> > ...
> >
> >> Named parameters is good feature, but what about the syntax in the
> >> sample, O also do not like it. If we use named parameters, it should be
> >> something like:
> >>
> >> S = 'INSERT INTO TTT VALUES (:a, :b, :a)';
> >> EXECUTE STATEMENT S (a=CURRENT_TRANSACTION, b=CURRENT_CONNECTION);
> >
> > Hmm... now i see where confusion is. I'll look how to implement such
> > syntax
>
> This is one of the confusions. :-)
>
> Note that I see no reason to reject such type of code:
> execute block
> as
> begin
> insert into t values (?)
> end;
>
> I.e., have parameters direct inside EXEC. BLOCK instead of need to
> declare variables.
>
> Then imagine you use colon there. You can't know if you refer to local
> variable or parameter. (unless we make explicit that locals variables
> have precedence)

As far as I can see any reference to parameter in EXECUTE STATEMENT happens
inside string constant. Parsers, preparing execute block, should better know
about strings :)