首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在尝试插入空格后加上"n“字符时ORA-00933

在尝试插入空格后加上"n“字符时ORA-00933
EN

Stack Overflow用户
提问于 2014-11-20 15:22:47
回答 1查看 395关注 0票数 0

我有下面的,但是当我尝试插入Varchar 'a‘时,它失败了。大小写不重要,唯一重要的部分似乎是‘n’是最后两个字符。当用蟾蜍和sqlplus手动执行时,它工作得很好。

默认的飞行路径占位符设置不变。

Flyway版本: 2.3,并在Ant Oracle数据库12.1.02.0中执行

代码语言:javascript
复制
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');

完整的堆栈跟踪:

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-11-21 08:03:56

这已经作为3.0的一部分被修正了

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27043167

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档