• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

accept command in .sql file not working from ant

 
Judit Raj
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having a sql file (Grant_Priv.sql) with 'accept' command.
Grant_Priv.sql:
------------------
accept USER prompt "Enter schema name :"
grant connect to &USER;

Using ant i am connecting to SQL and executing the SQL file:
----------------------------------------------------------------------------
<exec executable="sqlplus" dir="">
<arg value="sys/sys as sysdba"/>
<arg value="@C:\test\tmp1\Grant_Priv.sql"/>
</exec>

when ant executes the sql file, it has to prompr the user for username. But it is not asking username in my case. Instead, it is connecting to sql, displaying the below line and getting disconnected from sql.

Output:
---------
[exec] Connected to:
[exec] Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
[exec]
[exec] Enter schema name: Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
[echo] after exec
Main:

BUILD SUCCESSFUL
Total time: 2 seconds

Please help me how to make the sql file to prompt for username.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RTFM: The first sentence of the second paragraph in the Ant docs on exec reads:

Ant Docs wrote:Note that you cannot interact with the forked program, the only way to send input to it is via the input and inputstring attributes.


http://ant.apache.org/manual/Tasks/exec.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic