Domanda

I have encountered an Problem on my Oracle 11 Express installation running on Windows Xp 32Bit.

When I run a SQL-Script via Ant an Ora-00911 error is thrown every time when I use a double hyphen. When I run the exactly same code on my Oracle installation on Unix it works like a charm.

This is my query:

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

Is there any configuration that must be adapted? It seems to me that there is some kind of syntax check that thinks there is an SQL-Comment inside the comment-text.

Any idea what's causing this error?

È stato utile?

Soluzione

This is an Ant bug: https://issues.apache.org/bugzilla/show_bug.cgi?id=43413

You need to include the attribute keepformat="true" in your sql task:

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

   comment on table foo is 'Commenttest -- Testingtable';
</sql>

Altri suggerimenti

It looks like you are missing the closing single quote:

comment on table X.TABLE is 'Commenttest -- Testingtable';
                                                        ^----add this single quote

You are missing the terminating quote, please add as below:

     comment on table X.TABLE is 'Commenttest -- Testingtable';
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top