2016-03-01 56 views
4

Liquibase error: unterminated dollar-quoted string at or near "$BODY$`

Chaneg日誌XML有一個條目:參照下 包括文件=」/家庭的/ dev /....../ admin_script.sql」文件

內容:

............... 
CREATE OR REPLACE FUNCTION my_schema.function-name() 
RETURNS smallint AS 
$BODY$ 
    DECLARE 
     v_next_gen_id smallint := 0; 
    BEGIN 
.......... 

例外:

liquibase.exception.DatabaseException: Error executing SQL CREATE OR REPLACE FUNCTION function name() ETURNS smallint AS $BODY$ DECLARE v_next_gen_id smallint := 0: ERROR: unterminated dollar-quoted string at or near "$BODY$

感謝所有幫助解決這個

+0

[錯誤:未結束的引號的字符串或接近]的可能的複製(https://stackoverflow.com/questions/3499483/error-unterminated-quoted-string -at-or-near) – Andremoniy

回答

3

我剛剛在幾天前遇到過同樣的問題。

,如果我們使用下面的格式添加到變更文件changelog.xml它不工作:
<include file="path/to/sqlfile" />

要解決,我用另一種格式:

<changeSet author="authour_name" id="your_id"> 
    <sqlFile path="path/to/sqlfile" splitStatements="false"/> 
</changeSet> 

這裏是鏈接其中給出了對Problem with dollar-quoted-in-postgresql的簡要解釋。

1

使用<createProcedure>標籤,而不是在你的<changeSet>定義<sql>

+0

可以解釋爲什麼您的解決方案能夠提高您貢獻的價值? –

相關問題