web stats
Mirth Community - View Single Post - Oracle stored procedure call does not work
View Single Post
  #7  
Old 09-03-2018, 10:30 PM
shuhaibk54 shuhaibk54 is offline
Mirth Newb
 
Join Date: Jan 2018
Location: Abudhabi
Posts: 23
shuhaibk54 is on a distinguished road
Send a message via AIM to shuhaibk54 Send a message via Skype™ to shuhaibk54
Default

Thanks for advice . as per your advice function works well. Similarly I tried calling stored procedure . Yous simple push may help to finish this task .

I tried stored procedure for return entire table as result data .It return null .

below is sample stored procedure which I can fetch from c# code .
-------------------------------------------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;


-------------------------------------------------Mirth code ---------------
var dbConn = DatabaseConnectionFactory.createDatabaseConnection ('oracle.jdbc.driver.OracleDriver','jdbcracle:th in:@fun-host:1521:dbtest','hell','pwd');
conn = dbConn.getConnection();
var spstmt = conn.prepareCall("{call MIRTH_TEST_PROCEDURE(?) }");
spstmt.registerOutParameter(1, OracleTypes.CURSOR);
spstmt.execute();
var result = spstmt.getResultSet();
logger.debug("size=="+result.size()) // Error it return null : TypeError: Cannot call method "size" of null
-------------------------------------------------------------------------------
Error------------------
// Error it return null : TypeError: Cannot call method "size" of null

// OrcaleDBtestCONNECTOR:
SourceSOURCE CODE:
135: //logger.info("Channelname = " + Channelname);136: //var result=spstmt.executeUpdate();137: //var result=spstmt.executeQuery(); 138: 139: var result = spstmt.getResultSet();//getInt("pr_key");140: logger.debug("size=="+result.size());141: 142: //logger.info("new key=" + newnewKey);143: 144: LINE NUMBER:
140DETAILS:
TypeError: Cannot call method "size" of null

---------------------------------------------------------------------------
Reply With Quote