aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes how to execute pl/sql procedure using ant. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "how to execute pl/sql procedure using ant." Watch "how to execute pl/sql procedure using ant." New topic
Author

how to execute pl/sql procedure using ant.

prateek sharmaa
Ranch Hand

Joined: May 15, 2010
Posts: 38
hello everyone,

i am writing an ant target to execute pl/sql procedure which is as follows



running the ant target throwing below error

exportSizeRatio:
[sql] Executing commands
[sql] Failed to execute: exec plandatacsv
[sql] java.sql.SQLSyntaxErrorException: ORA-00900: invalid SQL statement
[sql] 0 of 1 SQL statements executed successfully

can anyone please help?

thanks,
pratz
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

Oracle doesn't like the SQL statement (line 08) that you are passing to it. Have you tried running that command using Oracle command line SQL interpreter?


JBoss In Action
prateek sharmaa
Ranch Hand

Joined: May 15, 2010
Posts: 38
hey peter,

Peter Johnson wrote:Oracle doesn't like the SQL statement (line 08) that you are passing to it. Have you tried running that command using Oracle command line SQL interpreter?


i tried running exec plandatacsv; using sqlplus and it executed successfully. may be there is some other way to do it using ant. do you have any idea?

thanks,
pratz
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

No, I do not know if there are any special ways of calling 'exec' via the JDBC driver (which is what is happening with this Ant task). Perhaps the Oracle JDBC driver docs will provide some clues.

Another thought: is there anything in the Oracle error log? Or could you turn on request logging within Oracle to see exactly what is being passed to Oracle?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to execute pl/sql procedure using ant.
 
Similar Threads
where to put rules?
write a PL-SQL code in java class
Problem using Callable Statement
Executing sqlplus or sqlldr from java code
new to oracle How to execute Stored Procedure