Forums Register Login

Error while trying to compile package using ant sql task

+Pie Number of slices to send: Send
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:

CREATE OR REPLACE PACKAGE UTIL
AS
FUNCTION get_result (p_lot IN VARCHAR2,
p_result_type IN VARCHAR2,
p_transaction_id IN NUMBER := NULL)
RETURN VARCHAR2;

FUNCTION get_result (p_transaction_id IN NUMBER,
p_result_type IN VARCHAR2)
RETURN VARCHAR2;


PROCEDURE change_mes_header_status (p_sakey IN NUMBER,
p_status IN VARCHAR2,
p_date_modified IN DATE,
p_error_message IN VARCHAR2);

END UTIL;

the way I run using ant is:

<sql driver="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@${jdbc.connectstring}"
userid="${sys_user} as sysdba"
password="${sys_user_password}"
print="yes"
showheaders="true">

<transaction src="/tmp/Sample.sql"/>
</sql>


Please help in resolving this.
When it is used for evil, then watch out! When it is used for good, then things are much nicer. Like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1158 times.
Similar Threads
Error while inserting data through procedure
simpleJdbcCall , org.springframework.jdbc.BadSqlGrammarException
Call an Oracle package
Receiving ORA-21700 Error most of the time
wrong number of type of argument while calling oracle procedure from java.
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 09:37:29.