# Pass in the variable to liquibase changelog script

**URL:** <https://forum.liquibase.org/t/pass-in-the-variable-to-liquibase-changelog-script/2512>\
**Category:** Liquibase Development\
**Created:** [October 21, 2011, 6:00am UTC](https://forum.liquibase.org/t/pass-in-the-variable-to-liquibase-changelog-script/2512 "2011-10-21T06:00:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kimpham6610](https://avatars.discourse-cdn.com/v4/letter/k/b5e925/32.png) [@kimpham6610](https://forum.liquibase.org/u/kimpham6610)\
**Post date:** [October 21, 2011, 6:00am UTC](https://forum.liquibase.org/t/pass-in-the-variable-to-liquibase-changelog-script/2512/1 "2011-10-21T06:00:00Z")

</div>

Hi All,

I am very new to liquibase. Sorry for the basic question. Here is my question.

I need to change the password to AES\_ENCRYPT and need to use key in this function. Is where any way that instead of hardcoded the KEY in change log script I can use the variable in changelog script for the key and this variable is set in the java code. Basically I didn’t want the KEY is hardcoded in the changelog script.

Do you have any suggestion?

Thanks in advance,

KL

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [October 21, 2011, 6:00am UTC](https://forum.liquibase.org/t/pass-in-the-variable-to-liquibase-changelog-script/2512/2 "2011-10-21T06:00:00Z")

</div>

There are&nbsp; [http://www.liquibase.org/manual/changelog\_parameters](http://www.liquibase.org/manual/changelog_parameters)&nbsp;changelog parameters which should be what you are looking for

Nathan

---

<div class="post-metadata">

**Author:** ![kimpham6610](https://avatars.discourse-cdn.com/v4/letter/k/b5e925/32.png) [@kimpham6610](https://forum.liquibase.org/u/kimpham6610)\
**Post date:** [October 21, 2011, 6:00am UTC](https://forum.liquibase.org/t/pass-in-the-variable-to-liquibase-changelog-script/2512/3 "2011-10-21T06:00:00Z")

</div>

Thanks,  
How to pass the variable to this liquibase?  
KP

---

<div class="post-metadata">

**Author:** ![kimpham6610](https://avatars.discourse-cdn.com/v4/letter/k/b5e925/32.png) [@kimpham6610](https://forum.liquibase.org/u/kimpham6610)\
**Post date:** [October 21, 2011, 6:00am UTC](https://forum.liquibase.org/t/pass-in-the-variable-to-liquibase-changelog-script/2512/4 "2011-10-21T06:00:00Z")

</div>

Thanks,  
Where to set this variable?

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [October 21, 2011, 6:00am UTC](https://forum.liquibase.org/t/pass-in-the-variable-to-liquibase-changelog-script/2512/5 "2011-10-21T06:00:00Z")

</div>

The bottom of the referenced page lists how:

Nathan

---

<div class="post-metadata">

**Author:** ![Guest](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@Guest](https://forum.liquibase.org/u/Guest)\
**Post date:** [October 21, 2011, 6:00am UTC](https://forum.liquibase.org/t/pass-in-the-variable-to-liquibase-changelog-script/2512/6 "2011-10-21T06:00:00Z")

</div>

Hi,  
I really don’t want to set this variable in the database changelog. Is it possible to set it as the environment variable?  
Thanks,  
KP

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [October 21, 2011, 6:00am UTC](https://forum.liquibase.org/t/pass-in-the-variable-to-liquibase-changelog-script/2512/7 "2011-10-21T06:00:00Z")

</div>

Yes, you can set it as a JVM system property by passing -Dpropertyname=value to java when it first starts, or as a parameter to ant, command line, or however you are running liquibase

Nathan

---

<div class="post-metadata">

**Author:** ![Guest](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@Guest](https://forum.liquibase.org/u/Guest)\
**Post date:** [October 21, 2011, 6:00am UTC](https://forum.liquibase.org/t/pass-in-the-variable-to-liquibase-changelog-script/2512/8 "2011-10-21T06:00:00Z")

</div>

Is it possible to escape a change log parameter? I browsed the source - it doesn’t look like it?

I need to insert the literal ${user.name} into my DB, and because this is the default Java system property, it is expanded to my user name.

Perhaps an Ant-like escape mechanism for dollar signs, such as $${user.name}?
