Author Login
Post Reply
You may want to use anforms to prompt for the values to feed in and create the bat file with the required inputs before you call it. My experience with the exec command is that it is attached to ant and not the keyboard. When it attempts to get input, there is none and it would exit or hang, depending on the program exec'd. I have had to use antforms to prompt for values for variables, create a bat file that includes the variables, execute the bat file and delete the bat file when I didn't want the information available as an artifact.
Thank you,
Chuck Holzwarth
(804) 403-3478 (home)
(540) 335-3171 (cell)
----- Original Message ----
From: Mike Stewart <MStewart@(protected)>
To: user@(protected)
Sent: Wednesday, April 23, 2008 6:43:21 AM
Subject: ANT and SQLPlus
I am trying to execute a SQLPlus script from ANT and have been unable to
get this to work when the SQLPlus script requires user input as in the
example below:
If I execute the ANT target Create:
<target name="Create" >
<exec executable="cmd" >
<arg value="/K" /> Note have also tried the
/C, /c, /k value here but have the same result
<arg value="Create.bat" />
</exec>
</target>
Where Create.bat contains the following line:
SQLPlus "SYS/sys@(protected)
Everything is ok until the newuser.sql requires an input, at this point
SQLPlus exits without waiting for the prompt:
[exec] Please input spool name. No file extension required (i.e.
DBC_SCR12345) >> Disconnected from Oracle9i Ente
rprise Edition Release 9.2.0.6.0 - Production
If the Create.bat is run from the command line it waits for the input
and executes as expected.
I've tried various combinations including running SQLPlus in place of
the cmd executable in ANT and had the same effect.
Any ideas?
Mike S.
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ