2

我在 Windows Xp 32Bit 上运行 Oracle 11 Express 安装时遇到了问题。

当我通过 Ant 运行 SQL 脚本时,每次使用双连字符时都会引发 Ora-00911 错误。当我在 Unix 上的 Oracle 安装上运行完全相同的代码时,它就像一个魅力。

这是我的查询:

comment on table X.TABLE is 'Commenttest -- Testingtable';

是否有任何必须调整的配置?在我看来,有某种语法检查认为注释文本中有一个 SQL 注释。

知道是什么导致了这个错误吗?

4

3 回答 3

3

这是一个 Ant 错误:https ://issues.apache.org/bugzilla/show_bug.cgi?id=43413

您需要keepformat="true"在 sql 任务中包含该属性:

<sql driver="oracle.jdbc.OracleDriver"
     url="jdbc:oracle:thin....."
     userid="scott"
     password="tiger"
     keepformat="true">

   comment on table foo is 'Commenttest -- Testingtable';
</sql>
于 2012-11-23T14:53:31.090 回答
2

看起来您缺少结束单引号:

comment on table X.TABLE is 'Commenttest -- Testingtable';
                                                        ^----add this single quote
于 2012-11-23T14:27:16.180 回答
1

您缺少终止报价,请添加如下:

     comment on table X.TABLE is 'Commenttest -- Testingtable';
于 2012-11-23T14:27:34.433 回答