3.12 Examples Using Liquibase
Some examples of using the Liquibase functionality for database change management tasks:
3.12.4 Execute Custom SQL with RunOracleScript
Create a RunOracleScript changeset to create a table and use PL/SQL variables
in the script.
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:n0="http://www.oracle.com/xml/ns/dbchangelog-ext"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<changeSet id="runScriptString" author="jdoe">
<n0:runOracleScript objectName="myScript" ownerName="JDOE"
sourceType="STRING">
<n0:source><![CDATA[
DEFINE table_name = RUNNERSTRING;
create table &&table_name (id number);
]]></n0:source>
</n0:runOracleScript>
</changeSet>
</databaseChangeLog>