# Problem with SQL scripts generated for loadUpdateData

**URL:** <https://forum.liquibase.org/t/problem-with-sql-scripts-generated-for-loadupdatedata/1940>\
**Category:** General Discussion\
**Created:** [April 23, 2012, 9:42am UTC](https://forum.liquibase.org/t/problem-with-sql-scripts-generated-for-loadupdatedata/1940 "2012-04-23T09:42:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nash\_j](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@nash\_j](https://forum.liquibase.org/u/nash_j)\
**Post date:** [April 23, 2012, 9:42am UTC](https://forum.liquibase.org/t/problem-with-sql-scripts-generated-for-loadupdatedata/1940/1 "2012-04-23T09:42:00Z")

</div>

Hi,

As a background, we run liquibase in our development environments and for production/staging deployments use liquibase (ant task updateDatabase) to generate the SQLs and then run the SQLs manually on the environments.

When generating SQL scripts for tasks that have loadUpdateData, liquibase generates anyonymous blocks of PL/SQL which need a “/” at the end of every block to be able to execute it. The behaviour is the same when the scripts are generated in either of the following ways:

a) java -jar liquibase-2.0.3.jar updateSQL

b) ant task updateDatabase. The task looks as below:

\<updateDatabase

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; changeLogFile=“changelog.xml”

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; driver="${jdbc.driverClassName}"

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; url="${jdbc.url}"

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; username="${jdbc.username}"

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; password="${jdbc.password}"

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; promptOnNonLocalDatabase=“false”

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dropFirst=“false”

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; classpathref=“classpath.db”

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; outputFile=“tmp\_db\_migrate\_output.sql”/\>

The actual updates using liquibase (java -jar liquibase-2.0.3.jar update) seem to be fine, the problem is with the generated SQL scripts. When the missing ‘/’ are added after every block, the script works fine. I did read through the liquibase documentation and could not find a way of configuring this behaviour.

I am attaching a small package to reproduce the problem - readme.txt contains all the relevant instructions.

Am I missing something? Is there a workaround ? Do I need to log a defect in JIRA?

Thanks

P.S. \>\> Had to remove the the ojdbc and &nbsp;liquibase jars because of size restrictions, we are using liquibase v2.0.3 and&nbsp;ojdbc14-10.2.0.4.jar for connectivity.

---

<div class="post-metadata">

**Author:** ![nash\_j](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@nash\_j](https://forum.liquibase.org/u/nash_j)\
**Post date:** [April 23, 2012, 9:42am UTC](https://forum.liquibase.org/t/problem-with-sql-scripts-generated-for-loadupdatedata/1940/2 "2012-04-23T09:42:00Z")

</div>

Anyone ? Do I need to chase this up in a different forum ?

---

<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:** [April 23, 2012, 9:42am UTC](https://forum.liquibase.org/t/problem-with-sql-scripts-generated-for-loadupdatedata/1940/3 "2012-04-23T09:42:00Z")

</div>

Sorry, behind on the forum.

I committed a fix that should add the /. It will be in 2.0.5 which will hopefully be out tomorrow.  
  
Nathan

---

<div class="post-metadata">

**Author:** ![nash\_j](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@nash\_j](https://forum.liquibase.org/u/nash_j)\
**Post date:** [April 23, 2012, 9:42am UTC](https://forum.liquibase.org/t/problem-with-sql-scripts-generated-for-loadupdatedata/1940/4 "2012-04-23T09:42:00Z")

</div>

Thanks Nathan, will wait for 2.0.5 to come out.

Regards.

---

<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:** [April 23, 2012, 9:42am UTC](https://forum.liquibase.org/t/problem-with-sql-scripts-generated-for-loadupdatedata/1940/5 "2012-04-23T09:42:00Z")

</div>

We tried to load some data into the DB using loadUpdateData tag and we found that it is appending “/;” after each generated SQL block, which will break if we run updateDatabase task from ant target.&nbsp;

e.g.&nbsp;

DECLARE

&nbsp; &nbsp; &nbsp; &nbsp; v\_reccount NUMBER := 0;

BEGIN

&nbsp; &nbsp; &nbsp; &nbsp; SELECT COUNT(\*) INTO v\_reccount FROM cupcakes WHERE code = ‘cac’;

&nbsp; &nbsp; &nbsp; &nbsp; IF v\_reccount = 0 THEN

INSERT INTO&nbsp;cupcakes&nbsp;(code, description) VALUES (‘cac’,‘cookies and cream’);

&nbsp; &nbsp; &nbsp; &nbsp; ELSIF v\_reccount = 1 THEN

UPDATE cupcakes SET description = 'cookies and cream ’ WHERE code = ‘cac’;

END IF;

END;

/;

We are using oracle 10.2.0.1.0 running on ubuntu 10.04.

Please advice on how to deal with this problem. Thanks

Andy

---

<div class="post-metadata">

**Author:** ![nash\_j](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@nash\_j](https://forum.liquibase.org/u/nash_j)\
**Post date:** [April 23, 2012, 9:42am UTC](https://forum.liquibase.org/t/problem-with-sql-scripts-generated-for-loadupdatedata/1940/6 "2012-04-23T09:42:00Z")

</div>

Hi Nathan / Dev group,

The comments above were logged by Andy who works with me on the same team. Did you have a chance to look into this? Basically, the fix you did resolves the problem with the generated SQL scripts, but causes the ant task to break.

Also, I could not find a corresponding JIRA issue in 2.0.5 release notes for the fix you committed…can you point me in the right direction?

Let me know if you need more info that could help.

Regards,

---

<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:** [April 23, 2012, 9:42am UTC](https://forum.liquibase.org/t/problem-with-sql-scripts-generated-for-loadupdatedata/1940/7 "2012-04-23T09:42:00Z")

</div>

Hey,  
  
you can take a look at this thread [http://forum.liquibase.org/topic/loadupdatedata-problem.](http://forum.liquibase.org/topic/loadupdatedata-problem.) There is a link to the Jira Task with is tagged with version 2.06 in it ([https://liquibase.jira.com/browse/CORE-1170).](https://liquibase.jira.com/browse/CORE-1170).)  
  
Greetings
