web stats
Mirth Community - View Single Post - Oracle stored procedure call does not work
View Single Post
  #1  
Old 08-10-2018, 03:44 AM
shuhaibk54 shuhaibk54 is offline
OBX.1 Kenobi
 
Join Date: Jan 2018
Location: Abudhabi
Posts: 26
shuhaibk54 is on a distinguished road
Send a message via AIM to shuhaibk54 Send a message via Skype™ to shuhaibk54
Default Oracle stored procedure call does not work

I am trying to fetch value from oracle database. it always give me an error . some body will guide me on right . Is that some thing related to out parameter ,if yes how we can handle it . Even i tried diffrent link in mirth forum like ..
--https://www.mirthcorp.com/community/forums/showthread.php?t=1677
--http://www.mirthproject.org/community/forums/showthread.php?t=4075

---------------------------------------------------------------------------------
var result=0;
var dbConn = DatabaseConnectionFactory.createDatabaseConnection ('oracle.jdbc.driver.OracleDriver','jdbcracle:th in:@192.168.0.226:1521:dbdb25','Dbname','XXX');
var sql = 'exec MIRTH_TEST_PROCEDURE';
var str = '';

try {
objresult = dbConn.executeCachedQuery(sql);
while (objresult.next())
{
str = objresult.getString('Channename');
}
}

catch (e) {
logger.info('call to db failed: ' + e);
}
---------------------------------------------------------------------------------


My oracle stored procedure ---


create or replace PROCEDURE MIRTH_TEST_PROCEDURE (
--p_MODE in number,
P_CURSOR OUT SYS_REFCURSOR)

AS
BEGIN
OPEN p_CURSOR FOR
select * from HL7_CLIENT_CHANNEL;

END;

-------------- Error ---------------------------------------------
[2018-08-10 12:06:54,020] INFO (js-connector:?): call to db failed: JavaException: java.sql.SQLSyntaxErrorException: ORA-00900: invalid SQL statement
Reply With Quote