You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Stefan Bodewig <bo...@bost.de> on 2000/10/19 13:08:00 UTC

Re: Using ant to launch Sqlplus scripts

>>>>> "JA" == Johan Adelöw <jo...@corustechnologies.com> writes:

 JA> Am I using the exec task in a bad way?

Yes, it's a simple misunderstanding. executable is really just the
name of the executable, all other arguments need to go int <arg>s.

 JA> <exec executable="sqlplus ${db_user}/${db_passwd}@${database_sid}" 
 JA>       dir="./" output="${logfile}" failOnError="true">
 JA>   <arg value="@${execfile}"/> 
 JA> </exec>

would become

<exec executable="sqlplus" 
      dir="./" output="${logfile}" failOnError="true">
  <arg value="${db_user}/${db_passwd}@${database_sid}" />
  <arg value="@${execfile}"/> 
</exec>

 JA> <exec executable=" echo ${exec_file}: >> ${logfile}" dir="${exec_dir}./" output="${os_log}" failOnError="true"/>

would become

<exec executable="echo" dir="${exec_dir}./" output="${os_log}" 
        failOnError="true"/>>
   <arg line="${exec_file}: >> ${logfile}" />
</exec>

and so on.

Furthermore, to get the >> interpreted, you need to invoke sh (it's sh
redirecting the output, not echo), probably

<exec executable="sh" dir="${exec_dir}./" output="${os_log}" 
        failOnError="true"/>>
   <arg value="-c" />
   <arg value="&quot;echo ${exec_file}: &gt;&gt; ${logfile}&quot;" />
</exec>

The &quot; and &gt; have been inserted by me, not my mailer 8-).

Stefan