ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: Running SQL Scripts from <exec>
Date Thu, 12 Jun 2003 05:06:27 GMT
If you really want to use Oracles sqlplus why not using that as executable?

<exec executable="d:\oracle\ora81\bin\sqlplus.exe">
    <!-- Would like to run an external sql script -->
    <arg value="thisuser/gouser@intranet_db@d:\sql_stuff.sql
d:\staging\log.log"/>
    <arg value="imp USERID=systemm/myuser@intranet_db FROMUSER=thisuser
TOUSER=newuser TABLES=my_table IGNORE=y FILE=d:\dump.dmp"/>
</exec>

But without knowing sqlplus, I think you should use <arg line/> instead of
<arg value/>,
because e.g. "imp USERID=... FROMUSER..." is _one_ value and I think sqlplus
wants several
values. I suggest using mutliple <arg> lines for better reading:

<exec executable="d:\oracle\ora81\bin\sqlplus.exe">
    <!-- Would like to run an external sql script -->
    <arg value="thisuser/gouser@intranet_db@d:\sql_stuff.sql" />
    <arg value="d:\staging\log.log" />
    <arg value="imp" />
    <arg value="USERID=systemm/myuser@intranet_db" />
    <arg value="FROMUSER=thisuser" />
    <arg value="TOUSER=newuser" />
    <arg value="TABLES=my_table" />
    <arg value="IGNORE=y" />
    <arg value="FILE=d:\dump.dmp"/>
</exec>


Jan


> -----Urspr√ľngliche Nachricht-----
> Von: Antoine Levy-Lambert [mailto:antoinelevyde@yahoo.com]
> Gesendet am: Mittwoch, 11. Juni 2003 18:13
> An: user@ant.apache.org
> Betreff: Re: Running SQL Scripts from <exec>
> 
> Paul, there is a sql task, that might be better than
> exec.
> Yours
> Antoine
> ----- Original Message ----- 
> From: "Beccio, Paul" <Paul.Beccio@baesystems.com>
> To: "'Ant Users List'" <user@ant.apache.org>
> Sent: Wednesday, June 11, 2003 6:07 PM
> Subject: Running SQL Scripts from <exec>
> 
> 
> > I'm writing a nightly data push with Ant and I'm
> stuck. If I wanted to run a
> > sql script from an exec file for an oracle push, can
> i just use the exec to
> > run an external sql file? How do I define where that
> sql file would reside
> > so Ant can find it? 
> > 
> > Something like:
> > 
> > <exec executable="cmd.exe">
> >    <arg value="d:\oracle\ora81\bin\sqlplus.exe"/>
> > <!-- Would like to run an external sql script -->
> >    <arg value="thisuser/gouser@intranet_db
> @d:\sql_stuff.sql >
> > d:\staging\log.log"/>
> >    <arg value="imp USERID=systemm/myuser@intranet_db
> FROMUSER=thisuser
> > TOUSER=newuser TABLES=my_table IGNORE=y
> FILE=d:\dump.dmp"/>
> > </exec>
> > 
> > Thanks!
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> user-help@ant.apache.org
> > 
> > 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> http://calendar.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

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