Liquibase migration with oracle pl/sql function gets PLS-00103

Viewed 2743

I'm trying to add simple oracle function, in SQLDeveloper it compiles and works, but when I add it to liquibase migration, migration fails.

CREATE OR REPLACE FUNCTION test_func
  (test_param       IN VARCHAR2
  ) RETURN INT
IS
  test_var INT;
BEGIN
  RETURN 0;
EXCEPTION
WHEN OTHERS THEN
  RAISE;
END test_func;
/

Error I got while migration

[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:2.0.3:update (liquibase) on project tools-liquibase: Error setting up or running Liquibase: Migration failed for change set .....
[ERROR] Reason: liquibase.exception.DatabaseException: Error executing SQL BEGIN
[ERROR] RETURN 0: ORA-06550: line 2, column 10:
[ERROR] PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:

PS: solution found, should add endDelimiter="/" for sqlFile or sql in liquibase changeset like

<changeSet id="..." author="andymur" logicalFilePath="">
        <comment></comment>
        <sqlFile endDelimiter="/"
                path="my.sql"/>
</changeSet>
0 Answers
Related