How to execute Set escape \; in liquibase

279 Views Asked by At

There are several insert sql statements which have \ in them. Originally the statements were written for manual execution from sql developer. So SET ESCAPE ; would work and the insert scripts also would be inserting the values as per expectations. While migrating to liquibase to automate the execution of sql statements the statement set escape \ is giving error in liquibase.

Have tried multiple ways to execute but nothing is working.

1

There are 1 best solutions below

1
PJatLiquibase On

SET ESCAPE is a client-side directive specifically for SQL Plus. There are two options when using Liquibase:

  1. With Liquibase Open Source, you probably don't need to include the SET ESCAPE directive at all, because Liquibase doesn't require the same escaping that SQL Plus does.

  2. With Liquibase Pro, you could use runWith to specifically use SQL Plus native executor on an Oracle database. You can see more about that here: https://docs.liquibase.com/concepts/changelogs/attributes/use-sql-plus-integration.html