ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keith Hatton" <khat...@axiomsystems.com>
Subject RE: <SQL> can't execute a ${property}?
Date Mon, 03 Nov 2003 09:02:47 GMT
The MySQL JDBC driver doesn't like multiple commands on the same line, that's what. Although
you can do this from the MySQL command-line client. Seems strange to me that it works if you
separate your commands onto multiple lines, but if it works for you ...



-----Original Message-----
From: William.R.Zwicky@erdc.usace.army.mil
[mailto:William.R.Zwicky@erdc.usace.army.mil]
Sent: 01 November 2003 05:00
To: user@ant.apache.org
Subject: RE: <SQL> can't execute a ${property}?


No dice.  Here is the exact task I'm running:

    <property name="testql" value="DROP TABLE countydata; DROP TABLE
airport;"/>

    <sql
      driver="${driver}"
      url="jdbc:mysql://${jdbc.server}/${jdbc.database}"
      userid="${mysql.ff.user}"
      password="${mysql.ff.passwd}"
      onerror="continue"
      keepformat="true">
      <classpath
path="../../lib/mysql-connector-java-3.0.8-stable-bin.jar"/>
${testql}
    </sql>

And the output:

      [sql] Executing commands
      [sql] Failed to execute:
      [sql] DROP TABLE countydata; DROP TABLE airport
      [sql] java.sql.SQLException: Syntax error or access violation,
message from server: "You have
 an error in your SQL syntax near '; DROP TABLE airport' at line 2"
      [sql] 0 of 1 SQL statements executed successfully

I get the same error if I copy put the query string itself inside the <sql>
task; but if I follow the first semicolon with a newline, it works fine.  So
*something* doesn't like multiple commands on the same line.  But what?
Who's parsing the SQL before it goes to MySQL?  And why does sourcing from a
file work fine?

-Bill

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



> -----Original Message-----
> From: W. Sean Hennessy [mailto:shennessy@goldenhourdata.com] 
> Sent: Thursday, October 30, 2003 10:35 AM
> To: 'Ant Users List'
> Subject: RE: <SQL> can't execute a ${property}?
> 
> <interesting suggestions>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message