I'm attempting to load some data into an HSQLDB database using Liquibase 1.9.5. I have a loadData
command as follows:
<loadData tableName="LIST_ITEM_TYPE" file="data/global/list_item_type.csv">
<column name="ID" type="NUMERIC" />
<column name="NAME" type="STRING" />
<column name="DESCRIPTION" type="STRING" />
</loadData>
In my CSV data file I'm attempting to set the ID value to the next value from an existing sequence:
id,name,description
next value for SEQ_ITEM_TYPE_ID,Test Name,A test description
However, this doesn't work as it generates the following SQL:
INSERT INTO LIST_ITEM_TYPE (id, description, name) VALUES ('next value for SEQ_ITEM_TYPE_ID', 'A test description', 'Test Name')
This is almost correct, except that the single quotes that Liquibase added around the next value for SEQ_ITEM_TYPE_ID
cause HSQLDB to give the following error:
java.sql.SQLException: data exception: invalid character value for cast
If I remove the sinqle quotes and run that SQL manually, it works as expected.
So, my question is, how do I use the Liquibase loadData
command pulling data from a CSV file while populating one of the columns from a sequence?