This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Error while trying to compile package using ant sql task 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 "Error while trying to compile package using ant sql task" Watch "Error while trying to compile package using ant sql task" New topic
Author

Error while trying to compile package using ant sql task

Gaurav Kr. Arora
Ranch Hand

Joined: Feb 20, 2011
Posts: 37
Hi,

I am facing issue while running a sql script using ant task sql.
In my sql I have a package and when I run the package from sql developer console, it gets compiled successfully but when i run using ant command, it gives below error:

Failed to execute: FUNCTION get_result (p_transaction_id IN NUMBER, p_result_type IN VARCHAR2) RETURN VARCHAR2
java.sql.SQLSyntaxErrorException: ORA-00900: invalid SQL statement
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:462)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:931)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:481)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:205)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:548)


The .sql file, contains the below piece:



the way I run using ant is:




Please help in resolving this.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

Try running ant with -v, that might give a clue as to exactly what the <sql> task is sending to the database. Also check your database logs, those should also tell you exactly what the database is seeing. Either of those might give a clue as to what went wrong.


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error while trying to compile package using ant sql task
 
Similar Threads
Error while trying to compile package using ant sql task
Error while inserting data through procedure
Receiving ORA-21700 Error most of the time
wrong number of type of argument while calling oracle procedure from java.
simpleJdbcCall , org.springframework.jdbc.BadSqlGrammarException