ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William.R.Zwi...@erdc.usace.army.mil
Subject <SQL> can't execute a ${property}?
Date Tue, 28 Oct 2003 05:46:49 GMT
I can't get the <sql> task to execute a property, and would appreciate any
help, as this problem is pretty strange.  I'm using:
  Java 1.4.1-b21
  Ant 1.6beta September 30 2003
  mysql  Ver 11.15 Distrib 3.23.41, for Win95/Win98 (i32)
and most importantly:
  mysql-connector-java-3.0.8-stable-bin.jar

The task statement is essentially
  <sql>${somesql}</sql>

The property 'somesql' contains 40 DROP TABLE statements.  When I execute
the task as above, I get the error:

      [sql] java.sql.SQLException: Syntax error or access violation,
message from server: "You have an error in your SQL syntax near ';
      [sql] DROP TABLE SIRRAdatainfo;
      [sql] DROP TABLE SIRRAinstall;
      [sql] DROP TABLE SIRRAprox;
      [sql] DROP ' at line 1"

The first DROP statement isn't in the error message, but that line plus the
text quoted in the error is exactly 100 chars.  But wait, it gets weirder.

If I copy these directly into my Ant file thusly:

  <sql>
  DROP TABLE SIRRAcnty;
  DROP TABLE SIRRAdatainfo;
  etc..
  </sql>

then the query works fine.  What's going on?  Why does using the property
cause <sql> to misinterpret the query?

-Bill

// William R. Zwicky
// USA-CERL  (217) 352-6511 x7405
// Champaign, IL

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message