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

Inserting the content of an XML file into a DB Table in a change-set

$
0
0

We have a table called XMLData with the column Data, type XML.

We want to insert the contents of an XML file (e.g. Customer.XML) that is located in a folder in the same directory with the change-log file. The XML file is very large. While it is technically possible to copy and paste it's contents into the change log file, that is not an option for us.

It would be ideal if there was a way to reference an external file in a changeset.

I'm trying to determine if Liquibase is appropriate for this task, and what the best way to do it within liquibase is.

Here is what I tried:

  <changeSet author="Jack" id="2016123456">
    <insert schemaName="MySchema" tableName="XMLData">
      <column name="Data" valueClobFile="Data\Customer.xml"/>
    </insert>
  </changeSet>

I get the following error:

Unexpected error running Liquibase: com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when converting date and/or time from character string. 

The error does not make sense to me because the data being inserted in an XML file. I get the same error even when the file content is empty.

Any suggestions or advice?

Thanks in advance.


Viewing all articles
Browse latest Browse all 2993

Trending Articles



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