ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From M Damon Hill <>
Subject perplexing exec mysql problem
Date Wed, 21 May 2003 20:02:29 GMT
good day...
I have been working on this now for a couple of hours and can't seem to see the problem with
the code. A little help from some extra eyes would be very appreciative.
I am trying to create a database in mysql and then execute some sql scripts on the newly created
database. All of this of course done using the <exec> task. Here is the code for a couple
of the targets in the build.xml:

<target name="init_db"><!--depends="transform_default_project"-->
  <exec executable="mysqladmin" output="createDB.output">
      <arg line="create ${}"/>
  <antcall target="sql_script_1"/>

<target name="sql_script_1">
  <exec executable="mysql" output="initDB.output">
    <arg line="${} &lt; ${sql.dir}/${sql1}"/>
  <antcall target="sql_script_2"/>

<target name="sql_script_2">
  <exec executable="mysql" output="initDB.output">
    <arg line="${} &lt; ${sql.dir}/${sql2}"/>
  <antcall target="sql_script_3"/>

Now as you can tell the script will first use mysqladmin to create the database. That particular
task executes just fine and creates the databse with no problems. However, whenever I run
the second target, in this case sql_script_1, it does not update the database and the resulting
exec returns a 1. 

I can run the same command from the command line on the machine I am testing this script on
and it works properly. The command is:
       mysql < path_to_script/sql1

This works fine like I say from the command line but not from inside ant.

Anyone have any thoughts or suggestions for this?? Seen anything like it before??

Thanks in advance!


Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message