执行 Liquibase 中的 “Set escape \;” 操作。

huangapple go评论82阅读模式
英文:

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时有两个选项:

  1. 使用Liquibase Open Source时,您可能根本不需要包括SET ESCAPE指令,因为Liquibase不需要与SQL Plus相同的转义。

  2. 使用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:

  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

huangapple
  • 本文由 发表于 2023年5月17日 20:31:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/76272134.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定