java - Oracle Stored Procedure - Spring Integration - OUT Type Object -


is possible have oracle type object output stored procedure, calling same using spring integration?

for example, have following in database:

create or replace type esp_training_req_obj object  (     v_param1 varchar2(25),     v_param2 varchar2(25) );  create or replace type esp_training_resp_obj object  (     v_param1 varchar2(25),     v_param2 varchar2(25) );  create or replace procedure test_proc (     v_req_obj in esp_training_req_obj,     v_resp_obj out esp_training_resp_obj ) begin     v_resp_obj := esp_training_resp_obj(v_req_obj.v_param2, v_req_obj.v_param1);     dbms_output.put_line('test_proc'); end; 

however, when try calling it, i'm getting following exception:

pls-00306: wrong number or types of arguments in call 'test_proc'

please find spring integration configuration bellow:

<int-jdbc:stored-proc-outbound-gateway         id="esp_training" request-channel="inputchannel"         stored-procedure-name="test_proc" data-source="datasource"         reply-channel="outputchannel"         skip-undeclared-results="false" ignore-column-meta-data="true">          <int-jdbc:sql-parameter-definition name="v_req_obj" direction="in" type="struct" />         <int-jdbc:sql-parameter-definition name="v_resp_obj" direction="out" type="struct" />          <int-jdbc:parameter name="v_req_obj" expression="payload.v_req_obj"/>      </int-jdbc:stored-proc-outbound-gateway> 

please note works fine if change sp declaration above, using struct in request only, example replacing esp_training_resp_obj varchar or other oracle primitive data type.

for example:

create or replace procedure test_proc (     v_req_obj in esp_training_req_obj,     v_status out varchar2 ) begin     v_status := v_req_obj.v_param1 || ' , ' || v_req_obj.v_param2;     dbms_output.put_line('test_proc'); end; 

the return-type on <int-jdbc:sql-parameter-definition> out param , sqlreturnstruct must solve issue.

the test-case in framework source codes contains sample clob handling:

<int-jdbc:stored-proc-outbound-gateway request-channel="getmessagechannel"                                        data-source="datasource"                                        stored-procedure-name="get_message"                                        ignore-column-meta-data="true"                                        expect-single-result="true"                                        reply-channel="output2channel">     <int-jdbc:sql-parameter-definition name="message_id"/>     <int-jdbc:sql-parameter-definition name="message_json" type="clob" direction="out" type-name="" return-type="clobsqlreturntype"/>     <int-jdbc:parameter name="message_id" expression="payload"/> </int-jdbc:stored-proc-outbound-gateway>  <bean id="clobsqlreturntype" class="org.mockito.mockito" factory-method="spy">     <constructor-arg>         <bean class="org.springframework.integration.jdbc.storedproc.clobsqlreturntype"/>     </constructor-arg> </bean> 

Comments