2

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?

Eyeless
  • 33
  • 4
  • 2
    I think this is a bug in Ant: https://issues.apache.org/bugzilla/show_bug.cgi?id=43413 so you might want to try `keepformat="true"` Btw: +1 for using database comments! –  Nov 23 '12 at 14:45
  • This is probably Ant problem See this post http://stackoverflow.com/questions/12469496/ant-sql-insert-statement-fails-on-strings-workaround – Petr Pribyl Nov 23 '12 at 14:50
  • thanks, keepformat="true" solved the problem! – Eyeless Nov 23 '12 at 15:03

3 Answers3

3

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>
2

It looks like you are missing the closing single quote:

comment on table X.TABLE is 'Commenttest -- Testingtable';
                                                        ^----add this single quote
Taryn
  • 242,637
  • 56
  • 362
  • 405
  • Sorry, my fault, the missing single quot was an copy error. I have it in my statement and I corrected my original post. – Eyeless Nov 23 '12 at 14:34
1

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

     comment on table X.TABLE is 'Commenttest -- Testingtable';
Yogendra Singh
  • 33,927
  • 6
  • 63
  • 73