0

We are trying to run a Stored procedure and a SQL statement in the same liquibase changeset using Liquibase 3.8.0 and getting below error.

Unexpected error running Liquibase: ORA-06550: line 12, column 2:PLS-00103: Encountered the symbol "/"

<changeSet author="cng-wow-initial" id="ad_group_role_mapping.sql2">
    <sqlFile dbms="oracle"
            encoding="utf8"
            path="../wrk/tables/ad_group__role_mapping.sql"
            splitStatements="false"
            stripComments="false" endDelimiter="\/"/>
</changeSet>

I have already tried :

  • endDelimiter="\n/\s*\n|\n/\s*$"
  • endDelimiter="\n/\s*(\n|$)"
  • endDelimiter="\n/\s*\n|\n/\s*$"
  • endDelimiter="/"
  • endDelimiter="/"
    DECLARE
            e_error EXCEPTION;
            PRAGMA exception_init ( e_error,-00942 );
        BEGIN
            EXECUTE IMMEDIATE 'drop table XXXX.AD_GROUP_ROLE_MAPPING';
        EXCEPTION
            WHEN e_error THEN
            NULL;
        END;

        /
        CREATE TABLE XXXX.AD_GROUP_ROLE_MAPPING(
            AD_GROUP_NAME VARCHAR2(200) NOT NULL,
            ROLE_ID NUMBER,
            PRIMARY KEY (AD_GROUP_NAME));
user1989406
  • 11
  • 1
  • 3
  • Did you see this question? https://stackoverflow.com/questions/32099621/pl-sql-and-sql-script-in-one-sqlfile-with-liquibase Try using `endDelimiter="/"` and removing the final semicolon `;` – kfinity Oct 11 '19 at 15:21
  • Yes,I tried that and get the below error ORA-06550: line 11, column 2: PLS-00103: Encountered the symbol "/" when expecting one of the following: ; – user1989406 Oct 16 '19 at 08:27
  • Why do you want these 2 things in one changeset? These statements are DDL statements. It is preferred to put every DDL statement in a separate changeset. – Stefan Mondelaers Oct 21 '19 at 11:49
  • Splitting up into 2 change sets would make this a lot easier and even if you don't want that, it is better to at least split up into 2 SQL files, so that you don't need attributes to make one of the statements work which can cause the other one to fail. – Stefan Mondelaers Oct 22 '19 at 16:21

0 Answers0