cmsimike / dbdeploy

Automatically exported from code.google.com/p/dbdeploy
0 stars 0 forks source link

ORA-00911: invalid character executing update script #82

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Executing follwing update sql script:
alter table CHARGE_SUMMARY add (START_TIME number(19,0));
update CHARGE_SUMMARY set START_TIME=END_TIME where START_TIME is null;
alter table CHARGE_SUMMARY modify (START_TIME not null enable);

On ORACLE DB leads to:

Applying #101: 101_alter_table_charge_summary.sql...
[ERROR] 
com.dbdeploy.exceptions.ChangeScriptFailedException: change script #101: 
101_alter_table_charge_summary.sql failed while executing statement 1:
alter table CHARGE_SUMMARY add (START_TIME number(19,0));
update CHARGE_SUMMARY set START_TIME=END_TIME where START_TIME is null;
alter table CHARGE_SUMMARY modify (START_TIME not null enable);
 -> ORA-00911: invalid character

    at com.dbdeploy.appliers.DirectToDbApplier.applyChangeScript(DirectToDbApplier.java:56)
    at com.dbdeploy.appliers.DirectToDbApplier.apply(DirectToDbApplier.java:30)
    at com.dbdeploy.Controller.processChangeScripts(Controller.java:40)
    at com.dbdeploy.DbDeploy.go(DbDeploy.java:122)
    at com.dbdeploy.mojo.UpdateDatabaseMojo.execute(UpdateDatabaseMojo.java:33)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:117)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
    at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:178)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
    at hudson.remoting.UserRequest.perform(UserRequest.java:118)
    at hudson.remoting.UserRequest.perform(UserRequest.java:48)
    at hudson.remoting.Request$2.run(Request.java:328)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:722)
Caused by: java.sql.SQLSyntaxErrorException: ORA-00911: invalid character

    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
    at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)
    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
    at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
    at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:193)
    at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:1033)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1329)
    at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1909)
    at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1871)
    at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:318)
    at com.dbdeploy.database.changelog.QueryExecuter.execute(QueryExecuter.java:22)
    at com.dbdeploy.appliers.DirectToDbApplier.applyChangeScript(DirectToDbApplier.java:54)
    ... 37 more

If I try to apply script via SQLplus, all is fine.

DBDeploy 3.0M3, Linux, Oracle 10.2, ojdbc 11.2.0.3

Original issue reported on code.google.com by jkaras...@gmail.com on 8 Apr 2015 at 12:18

GoogleCodeExporter commented 9 years ago
Try by adding your script in a block.
BEGIN
alter table CHARGE_SUMMARY add (START_TIME number(19,0));
update CHARGE_SUMMARY set START_TIME=END_TIME where START_TIME is null;
alter table CHARGE_SUMMARY modify (START_TIME not null enable);
end;

Original comment by prabhaj...@gmail.com on 28 May 2015 at 11:55