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 executing external scripts using @other_script.sql #705

Closed
rehand opened this issue Feb 21, 2014 · 6 comments
Closed

Add support for executing external scripts using @other_script.sql #705

rehand opened this issue Feb 21, 2014 · 6 comments

Comments

@rehand
Copy link

rehand commented Feb 21, 2014

As Flyway says, that is is compatible with all scripts which can be executed by SqlPlus ('Any Oracle sql script executed by Flyway, can be executed by SqlPlus [...]'), it would be nice to add support for executing other scripts within a script file like the following:

@other_script_1.fnc
@other_script_1.syn
@other_script_1.grt

Currently, Flyway interprets this as error:

ERROR: Error executing statement at line 1: @other_script_1.fnc
@other_script_1.syn
@other_script_1.grt

ERROR: Caused by: java.sql.SQLException: ORA-00900: invalid SQL statement

ERROR: Occured in oracle.jdbc.driver.DatabaseError.throwSqlException() at line 112

Is there a way to add support for this? Otherwise I'd have to change all existing scripts in order to be able to use Flyway.

@axelfontaine
Copy link
Contributor

Thanks for the report. I've documented it as a limitation. I have no immediate plans to fix this, as this has all kinds of hairy implications regarding loading and executing of these files (classpath, transactions, error handling, ...)

@cosmin
Copy link

cosmin commented Jan 9, 2015

+1 for finding a solution for this problem at some point. Loading the files from class path would work for my use case and I'm not clear what transaction or error handling limitations this would involve.

@KevinSheedy
Copy link

+1 I'm using Flyway for DDL but I still depend on SqlPlus for deploying procedures, functions from a single source of the truth in our git repo.
It'd be great if we could do it all with Flyway.

@axelfontaine axelfontaine changed the title Add support for executing scripts Add support for executing external scripts using @other_script.sql Feb 7, 2017
@adamlukaszewski
Copy link

+1 Would be greate to have this feature. We organize our sources (packages, table definitions, etc.) in different subfolders with (of course) git. With git and specific branches we ensure not to deploy sources in the wrong version. Nowadays we use a kind of install manifest (e.g. 1_5_5.sql) to reference this files. Actually the same way like flyway does it but not automated.

Cheers
Adam L.

@axelfontaine
Copy link
Contributor

axelfontaine commented Jan 2, 2018

This should include support for both the @ and @@ (files only for now, no URLs) as well as the SET SUFFIX SQL*Plus commands.

To ensure parameters are processed correctly, #1883 should be implemented first.

Reference docs:

@axelfontaine
Copy link
Contributor

This has now been implemented.

axelfontaine pushed a commit to flyway/flywaydb.org that referenced this issue Sep 5, 2018
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
Development

No branches or pull requests

5 participants