我正在尝试使用loadupdatedata在csv中插入新值。对于Oracle,liquibase使用DECLARE,BEGIN和END生成一个PL-SQL块。我们使用生成的SQL文件来部署在不同的环境中,而不是通过mvn执行liquibase。我们如何才能在末尾得到一个'/',以便sql文件可以通过sqlplus正常运行?
<preConditions onFail="CONTINUE">
<tableExists tableName="organization"/>
</preConditions>
<loadUpdateData tableName="organization"
primaryKey="name"
file="changelog/data/INSERTS_ORGANIZATION.csv">
<column name="name" type="STRING"/>
</loadUpdateData>
</changeSet>
Generated sql looks like
DECLARE
v_reccount NUMBER := 0;
BEGIN
SELECT COUNT(*) INTO v_reccount FROM organization WHERE name = 'Test Organization';
IF v_reccount = 0 THEN
INSERT INTO organization (name) VALUES ('Test Organization');
END IF;
END;
How to get an '/' after END; so that it runs fine with sqlplus?