英文:
How to execute Set escape \; in liquibase
问题
以下是翻译好的部分:
有几个插入 SQL 语句中含有 \。
最初这些语句是为了在 SQL 开发者中手动执行而编写的。
所以 SET ESCAPE ; 会起作用,插入脚本也会按照期望插入值。
在迁移到 Liquibase 以自动执行 SQL 语句时,SET ESCAPE \ 语句在 Liquibase 中报错。
尝试了多种执行方式,但都不起作用。
英文:
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
得分: 1
SET ESCAPE是针对SQL Plus的客户端指令。在使用Liquibase时有两个选项:
-
使用Liquibase Open Source时,您可能根本不需要包括SET ESCAPE指令,因为Liquibase不需要与SQL Plus相同的转义。
-
使用Liquibase Pro时,您可以使用runWith来专门在Oracle数据库上使用SQL Plus本地执行器。您可以在这里了解更多信息:https://docs.liquibase.com/concepts/changelogs/attributes/use-sql-plus-integration.html
英文:
SET ESCAPE is a client-side directive specifically for SQL Plus. There are two options when using Liquibase:
-
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.
-
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论