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

Script executed but data not persisted

$
0
0
I am working on a database migration in which we migrate data from 1 table to 2 other tables. For this I use a PL/SQL script. A very simplified version of the script is visible below:

  1. BEGIN
  2.   FOR foo IN (SELECT * FROM FOO) LOOP
  3.     INSERT INTO BAR (ID, STATUS)
  4.     VALUES (foo.ID, foo.STATUS);

  5.     FOR foolog IN (SELECT * FROM FOO_LOG where ID = foo.ID) LOOP
  6.       INSERT INTO BAR_LOG (ID, REV);
  7.       VALUES (FOO_SEQ.CURRVAL, foolog.REV);
  8.     END LOOP;
  9.   END LOOP;
  10. END;
The problem is: liquibase runs the script but no data is persisted to the database, it looks as if the script doesn't run. If I introduce a typo on purpose (change a table name for example) the script fails to run so it does actually execute the script. Also, when I run the SQL manually it works as expected so it seems that the problem is related to liquibase. 

Any clue of why this happens/how to solve this?

Viewing all articles
Browse latest Browse all 2993

Trending Articles



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