oracle - PL/SQL and SQL script in one sqlFile with liquibase? -
i try lot options run in room changeset/sqlfile contains pl/sql block , simlple sql statement. e.g.:
begin aud.someprocedure('parameter'); end; / insert test_table(_id, value) values(1, 'test');
but following exception:
liquibase.exception.migrationfailedexception: migration failed change set [xml path]: reason: liquibase.exception.databaseexception: ora-06550: 4 line, 1 col: pls-00103: encountered symbol: "/" [failed sql: begin aud.someprocedure('parameter'); end; // insert test_table(_id, value) values(1, 'test') ] @ liquibase.changelog.changeset.execute(changeset.java:584) @ liquibase.changelog.visitor.updatevisitor.visit(updatevisitor.java:51) @ liquibase.changelog.changelogiterator.run(changelogiterator.java:73) @ liquibase.liquibase.update(liquibase.java:210) @ liquibase.liquibase.update(liquibase.java:190) @ liquibase.liquibase.update(liquibase.java:186) @ org.jenkinsci.plugins.liquibase.builder.liquibasebuilder.perform(liquibasebuilder.java:128) @ hudson.tasks.buildstepmonitor$1.perform(buildstepmonitor.java:20) @ hudson.model.abstractbuild$abstractbuildexecution.perform(abstractbuild.java:779) @ hudson.model.build$buildexecution.build(build.java:205) @ hudson.model.build$buildexecution.dorun(build.java:162) @ hudson.model.abstractbuild$abstractbuildexecution.run(abstractbuild.java:537) @ hudson.model.run.execute(run.java:1741) @ hudson.model.freestylebuild.run(freestylebuild.java:43) @ hudson.model.resourcecontroller.execute(resourcecontroller.java:98) @ hudson.model.executor.run(executor.java:381) caused by: liquibase.exception.databaseexception: ora-06550: 4 line, col oszlop: pls-00103: encountered symbol: "/" [failed sql: begin aud.someprocedure('parameter'); end; // insert test_table(_id, value) values(1, 'test') ]
when try change in xml splitstatement , enddelimiter, nothing changed.
do have eny idea?
the "enddelimiter" works perfectly.
semicolon in sql statement produces "invalid character error", have remove when isn't delimiter. (yes, work in pl/sql , sql*plus, slash "/", more: when need use semicolon vs slash in oracle sql? )
solutions:
enddelimiter = "/"
<changeset id="1" author="me"> <sql enddelimiter="/"> begin aud.someprocedure('parameter'); end; / insert test_table(_id, value) values(1, 'test') </sql> </changeset>
two sections
<changeset id="1" author="me"> <sql enddelimiter="/"> begin aud.someprocedure('parameter'); end; </sql> <sql> insert test_table(_id, value) values(1, 'test'); </sql> </changeset>
or maybe ;)
<changeset id="1" author="me"> <sql enddelimiter="#gabor here#"> begin aud.someprocedure('parameter'); end; #gabor here# insert test_table(_id, value) values(1, 'test') </sql> </changeset>
Comments
Post a Comment