Quantcast
Channel: Liquibase Forums
Viewing all articles
Browse latest Browse all 2993

Re : sqlFile tag not expanding placeholders

$
0
0
Hi
I tried parameter replacement in 3.2.0 against oracle and it didn't work for <SQLFILE>.
It did work for <SQL>.

This is the command line I'm using

java -DchangeId=1405045580= -jar ../../../standaloneCmdLineExample/liquibase-3.2.0-bin/liquibase.jar --defaultsFile=./liquibase.properties --changeLogFile=./simpleSQLFileExamplechangelogfile.xml update

This is the change log file

<?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" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
     <property name="client" value="myClient"/> 
<changeSet author="tom" id="${changeId}">
  <sql endDelimiter="##">
begin
insert into info values( to_char( sysdate, 'YYYY/MM/DD HH24:MI:SS')||'value replacement in SQL tag ${client}');
end;--#/
</sql>
  <sqlFile dbms="oracle" encoding="utf8" endDelimiter="--#/" path="./simpleSQLFileExample.sql" relativeToChangelogFile="true" splitStatements="true" stripComments="true"/>
</changeSet>
</databaseChangeLog>


This is the contents of ./simpleSQLFileExample.sql

begin
 insert into info values( to_char( sysdate, 'YYYY/MM/DD HH24:MI:SS')||'value replacement in sqlFile tag ${client}');
end;
--#/

This is the result of select * from info

SQL*Plus: Release 11.2.0.2.0 Production on Fri Jul 11 14:21:34 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

SQL> select * from info;

INFO
--------------------------------------------------------------------------------
2014/07/11 14:18:00value replacement in SQL tag myClient
2014/07/11 14:18:00value replacement in sqlFile tag ${client}

Thanks

b.t.w this is a great tool!

Tom


Viewing all articles
Browse latest Browse all 2993

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>