Search code examples
sqloracle-databaseliquibaseoracle19c

In Liquibase is it OK to have an empty line on splitstatements?


In Liquibase is it OK to have an empty line on splitstatements?

Bellow I want to execute 2 statements:

--changeset me:1 runAlways:false runOnChange:false failOnError:true splitStatements:true endDelimiter:;
update my_table
set    col = 1
where  col is null;

alter table my_table modify col not null;

Solution

  • Yes it's ok to have an empty line in between multiple queries to be executed. splitStatements basically search for the provided end-delimeter and splits multiple queries for execution. So having a new line would not cause any issue. The changeset snippet you provided in the question should work.

    By default the value of splitStatements is set to true which splits the statements on ;s. Have a look at splitStatements attribute in liquibase document here.