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

How to call an Oracle stored procedure from changelog/changeset

$
0
0
Here is what i tried:

  1. <changeSet id="2016-08-25-cn" author="user1">
  2.            <comment>
  3.                         Testing retry logic on liquibase
  4.                 </comment>
  5.                         <sql>splitStatements='true'>CALL RETRY-TRANS-EXCEPTION();</sql>
  6.            </changeSet>
  7. </databaseChangeLog>

and the sql file:

  1. CREATE OR REPLACE PROCEDURE RETRY-TRANS-EXCEPTION
  2. AS
  3.  v_query varchar2(100);
  4. BEGIN
  5. FOR i IN 1..5 LOOP
  6.         DBMS_OUTPUT.PUT('Try #' || i);
  7.         v_query := 'ALTER TABLE CIS_CASE ADD TEST01 varchar2(1) NOT NULL' ;
  8.    execute immediate v_query;
  9.    END loop;
  10. END;
  11. /

Error on running liquibase update


liquibase update Failed: Migration failed for change set changelog.xml::2016-08-25-cnwillia-01::user1: Reason: liquibase.exception.DatabaseException: Error executing SQL splitStatements='true'>CALL RETRY-TRANS-EXCEPTION(): ORA-00900: invalid SQL statement


Viewing all articles
Browse latest Browse all 2993

Trending Articles



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