Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for nested declarations in Firebird procedural logic #9953

Closed
lukaseder opened this issue Mar 12, 2020 · 1 comment
Closed

Add support for nested declarations in Firebird procedural logic #9953

lukaseder opened this issue Mar 12, 2020 · 1 comment

Comments

@lukaseder
Copy link
Member

In Firebird, we currently cannot use this kind of pattern:

create().begin(
    declare(i),
    i.set(1),

    declare(j),
    j.set(2),

    insertInto(t).columns(a, b).values(i, j)
).execute();

Firebird allows variable declarations only at the very beginning of an EXECUTE BLOCK AS statement, and that statement cannot be nested, see: https://stackoverflow.com/q/60654899/521799

We could probably re-write the entirety of the anonymous block, declaring all variables up front, and aliasing variables in case of ambiguities (which would also solve T-SQL's lack of block scope: #8314)

Some variable declarations are emitted by emulations, such as the indexed for loop, which currently doesn't work in Firebird because of the necessity of declaring a loop variable.

@lukaseder
Copy link
Member Author

This has been fixed as #11366

3.14 More procedural support automation moved this from To do to Done Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant