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

DB2 stored procedure nested block support #1691

Closed
franciskittu opened this issue Jul 3, 2017 · 2 comments
Closed

DB2 stored procedure nested block support #1691

franciskittu opened this issue Jul 3, 2017 · 2 comments
Labels
Milestone

Comments

@franciskittu
Copy link

@franciskittu franciskittu commented Jul 3, 2017

I'm running flyway command-line 4.2.0 against DB2 9.7 FIXPACK 7 on WINDOWS 64bit.

I tried to migrate just one SQL file containing a dummy procedure definition with nested BEGIN END block.


CREATE PROCEDURE dummy_proc ()
LANGUAGE SQL
BEGIN
    declare var1 TIMESTAMP;
    
    SELECT CURRENT_TIMESTAMP INTO var1 FROM SYSIBM.DUAL;
    
    BEGIN
        declare var2 DATE;
        SELECT CURRENT_DATE INTO var2 FROM SYSIBM.DUAL;
    END;
END; -- here I tried with and without the ";" char and also with "@" and --#SET TERMINATOR @ at the beginning

The statement correctly compile by running it on a DB2 client. So, the result should be the same on flyway.

Instead, the migration failed due to a -104 error. The same applies to every procedure containing nested blocks.

@axelfontaine axelfontaine added this to the Flyway 5.0.0 milestone Jul 3, 2017
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Jul 3, 2017

The --#SET TERMINATOR case should now work correctly with the fix for #1690

However without that, nesting is indeed not supported yet.

@franciskittu
Copy link
Author

@franciskittu franciskittu commented Jul 3, 2017

Ok, thanks for your support.

@axelfontaine axelfontaine changed the title stored procedure nested block management DB2 stored procedure nested block management Jul 6, 2017
@axelfontaine axelfontaine changed the title DB2 stored procedure nested block management DB2 stored procedure nested block support Jul 6, 2017
axelfontaine added a commit to flyway/flywaydb.org that referenced this issue Jul 6, 2017
dohrayme pushed a commit to dohrayme/flyway that referenced this issue Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.