# Inserting string "NULL" into column

**URL:** <https://forum.liquibase.org/t/inserting-string-null-into-column/742>\
**Category:** General Discussion\
**Created:** [August 19, 2010, 9:30am UTC](https://forum.liquibase.org/t/inserting-string-null-into-column/742 "2010-08-19T09:30:00Z")\
**Posts on this page:** 7\
**Page:** 2

<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:** [August 19, 2010, 9:30am UTC](https://forum.liquibase.org/t/inserting-string-null-into-column/742/21 "2010-08-19T09:30:00Z")

</div>

You would insert empty strings now by passing an empty string.&nbsp; It is currently hard-coded to support nullPlaceholder=“null” but that is the only value that will convert to null.

An XSLT would be a good idea, probably on the extensions area.&nbsp; It woudl be best to fix it with 2.0, but I’m really wanting to get it released.&nbsp; If it is easy to implement and does not introduce issues I would be fine including it in 2.0.

Nathan

---

<div class="post-metadata">

**Author:** ![dean.m.jones](https://avatars.discourse-cdn.com/v4/letter/d/ba8739/32.png) [@dean.m.jones](https://forum.liquibase.org/u/dean.m.jones)\
**Post date:** [August 19, 2010, 9:30am UTC](https://forum.liquibase.org/t/inserting-string-null-into-column/742/22 "2010-08-19T09:30:00Z")

</div>

Hi Nathan, Oleg,

I’m not sure that this fixes my original problem, which was that I want to insert the string “NULL” into a column. This was working previously at 1.9, but isn’t working with the trunk at revision 1776.

Best wishes,

Dean.

---

<div class="post-metadata">

**Author:** ![taranenko](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@taranenko](https://forum.liquibase.org/u/taranenko)\
**Post date:** [August 19, 2010, 9:30am UTC](https://forum.liquibase.org/t/inserting-string-null-into-column/742/23 "2010-08-19T09:30:00Z")

</div>

Dean,  
introducing the nullPlaceholder=“null” attribute and “” as empty, but not null value, will fix you original problem.  
You may specify nullPlaceholder=“WhatIsNotCurrentInUseString” and your “null” value will be treated as a string.  
I think a XSLT script may be written as a separate facility and might be applied to the liquibase changeset files external to the liquibase core/extension functionality through ant/maven before manipulation with checksums, that is required for jump 1.9 -\> 2.0.

---

<div class="post-metadata">

**Author:** ![dean.m.jones](https://avatars.discourse-cdn.com/v4/letter/d/ba8739/32.png) [@dean.m.jones](https://forum.liquibase.org/u/dean.m.jones)\
**Post date:** [August 19, 2010, 9:30am UTC](https://forum.liquibase.org/t/inserting-string-null-into-column/742/24 "2010-08-19T09:30:00Z")

</div>

Hi Oleg - my concern is that currently that the nullPlaceholder attribute isn’t used and liquibase is hard-coded to use the string “null” (case-insensitive) to indicate a value, which is where we started.

Best wishes,

Dean.&nbsp;

---

<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:** [August 19, 2010, 9:30am UTC](https://forum.liquibase.org/t/inserting-string-null-into-column/742/25 "2010-08-19T09:30:00Z")

</div>

Yes, since I’m pushing off the nullPlaceholder feature until a later release, to insert rows with the string “null”, you are going to have to use the tag.&nbsp; Hopefully it will be able to be a part of 2.1 before long.

Nathan

---

<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:** [August 19, 2010, 9:30am UTC](https://forum.liquibase.org/t/inserting-string-null-into-column/742/26 "2010-08-19T09:30:00Z")

</div>

You can always also use the raw tags for the times you do need to insert the string “null” until the nullPlaceholder feature is implemented

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:** [August 19, 2010, 9:30am UTC](https://forum.liquibase.org/t/inserting-string-null-into-column/742/27 "2010-08-19T09:30:00Z")

</div>

For me it seems as a really bad idea to interprete the value at all.  
What are you doing with NULL, NULL, _NULL_, ‘NULL’? What are you doing if you have two columns which need different placeholders? How do you want to document this behaviour?  
  
And it is unclear why you need the line with the column tag at all if you want that value to be NULL, the default. If you want to overwrite the default value, than you could use a special property, e.g. nullValue=“true” or isNull=“true”.  
  
And the diff should also produce the right changeSet if it finds the string null. Which 2.0.4 does not do.

[Previous page](https://forum.liquibase.org/t/inserting-string-null-into-column/742.md?page=1)
