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 change delimiter using --#SET TERMINATOR #1163
Comments
We have the same issue for DB2 Z/OS. Seems this fix has not been implemented for DB2 Z/OS. Can this also be fixed for DB2 Z/OS? |
Hi,
Instead, the script above will rollback due to the failure of the second statement. In order to execute the entire file using @ as delimiter the developer should write:
I suppose this is not the intended support for this feature. Do you agree? Am I wrong with something? |
The fix works correct way (first one described by you). You may put SET TERMINATOR at any line and it will work until end of file or next SET TERMINATOR. You can test it if any suspicions. |
Thanks for your reply. |
We use org.flywaydb:flyway-core:3.2.1 as jar dependency. And we put java files into our project so it loads after flyway.jar and overrides flyway's classes. And it works correctly from SET until end of file. Thats all I know. PS: there some other fixes for flyway db2. You can share them with developers. |
Ok. Thanks for your time. |
I use flyway 4.2.0 and still have the problem. i need to repeat the SET TERMINATOR before each command. My Statement-file is about 500 commands. Where is my mistake ? |
We couldn't get this to work with Flyway 4.2.0, which is a shame. We resorted to creating the procedure outside Flyway and then only calling the procedure from within Flyway. That worked for us. |
I can confirm the issue for flyway 4.2.0. For this version the mentioned workaround (repeating SET TERMINATOR) is required. |
There no way to create migration script with stored procedures with custom delimiter for DB2.
I've seen the http://stackoverflow.com/questions/15938000/set-terminating-character-in-flyway-for-db2-procedure-creation but we have a procedures with many enclosed begin-end statements, so current version of DB2SqlStatementBuilder fails.
At now I fix the issue with a trick:
http://stackoverflow.com/questions/30897357/flyway-db2-change-delimiter-not-working
So there a lot of possible solutions like set DELIMITER_KEYWORD evidently by java method for Flyway class, or set custom DbSupportFactory, or may be another solution that will fit the common concept of Flyway developing. Or may be parse native DB2 comment "--#SET TERMINATOR" the appreciated way.
The text was updated successfully, but these errors were encountered: