2014-11-20 5 views
0

다음 SQL 마이그레이션 스크립트가 있지만 Varchar 'a n'을 삽입하려고하면 실패합니다. 대소 문자는 중요하지 않으며 중요한 부분은 'n'이 마지막 두 문자입니다. Toad 및 sqlplus를 사용하여 수동으로 실행하면 올바르게 작동합니다.ORA-00933 "n"문자 다음에 공백을 넣으려고 할 때

기본 이동 경로 자리 표시 자 설정은 변경되지 않습니다.

이동 경로 버전 : 2.3 개미 오라클 데이터베이스와 실행은 12.1.02.0

CREATE TABLE TEST(
    TEST VARCHAR2(40) NOT NULL 
); 

-- This works 
INSERT INTO TEST (TEST) VALUES ('a b'); 
INSERT INTO TEST (TEST) VALUES ('a an'); 
INSERT INTO TEST (TEST) VALUES ('a nn'); 
INSERT INTO TEST (TEST) VALUES ('a n '); 

-- This does not 
INSERT INTO TEST (TEST) VALUES ('a n'); 

는 전체 스택 트레이스는 :

build.xml:38: Flyway Error: com.googlecode.flyway.core.command.FlywaySqlScriptException: Error executing statement at line 12: INSERT INTO TEST (TEST) VALUES (' n'); 
    at com.googlecode.flyway.ant.AbstractFlywayTask.execute(AbstractFlywayTask.java:331) 
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
    at java.lang.reflect.Method.invoke(Unknown Source) 
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) 
    at org.apache.tools.ant.Task.perform(Task.java:348) 
    at org.apache.tools.ant.Target.execute(Target.java:392) 
    at org.apache.tools.ant.Target.performTasks(Target.java:413) 
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399) 
    at org.apache.tools.ant.Project.executeTarget(Project.java:1368) 
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) 
    at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32) 
    at org.apache.tools.ant.Project.executeTargets(Project.java:1251) 
    at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:424) 
    at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:138) 
Caused by: java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended 

    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.googlecode.flyway.core.dbsupport.JdbcTemplate.executeStatement(JdbcTemplate.java:230) 
    at com.googlecode.flyway.core.dbsupport.SqlScript.execute(SqlScript.java:90) 
    at com.googlecode.flyway.core.resolver.sql.SqlMigrationExecutor.execute(SqlMigrationExecutor.java:72) 
    at com.googlecode.flyway.core.command.DbMigrate$2.doInTransaction(DbMigrate.java:243) 
    at com.googlecode.flyway.core.command.DbMigrate$2.doInTransaction(DbMigrate.java:241) 
    at com.googlecode.flyway.core.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72) 
    at com.googlecode.flyway.core.command.DbMigrate.applyMigration(DbMigrate.java:241) 
    at com.googlecode.flyway.core.command.DbMigrate.access$700(DbMigrate.java:44) 
    at com.googlecode.flyway.core.command.DbMigrate$1.doInTransaction(DbMigrate.java:186) 
    at com.googlecode.flyway.core.command.DbMigrate$1.doInTransaction(DbMigrate.java:135) 
    at com.googlecode.flyway.core.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72) 
    at com.googlecode.flyway.core.command.DbMigrate.migrate(DbMigrate.java:135) 
    at com.googlecode.flyway.core.Flyway$1.execute(Flyway.java:872) 
    at com.googlecode.flyway.core.Flyway$1.execute(Flyway.java:819) 
    at com.googlecode.flyway.core.Flyway.execute(Flyway.java:1200) 
    at com.googlecode.flyway.core.Flyway.migrate(Flyway.java:819) 
    at com.googlecode.flyway.ant.MigrateTask.doExecuteWithMigrationConfig(MigrateTask.java:162) 
    at com.googlecode.flyway.ant.AbstractMigrationLoadingTask.doExecute(AbstractMigrationLoadingTask.java:271) 
    at com.googlecode.flyway.ant.AbstractFlywayTask.execute(AbstractFlywayTask.java:329) 
    ... 16 more 
+1

의 일환으로 수정되었습니다 이동 경로의 버그. –

+0

3.0으로 업그레이드하고 다시 시도하십시오. –

+0

@AxelFontaine 고맙습니다. 3.0과 함께 작동합니다! 답변으로 게시 할 수 있습니까? (해결책으로 그것을 문서화하기 위해) – Slettal

답변

0

이이 같은 소리 3.0